use of de.schildbach.wallet.ui.InputParser.BinaryInputParser in project bitcoin-wallet by bitcoin-wallet.
the class WalletActivity method handleIntent.
private void handleIntent(final Intent intent) {
final String action = intent.getAction();
if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
final String inputType = intent.getType();
final NdefMessage ndefMessage = (NdefMessage) intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES)[0];
final byte[] input = Nfc.extractMimePayload(Constants.MIMETYPE_TRANSACTION, ndefMessage);
new BinaryInputParser(inputType, input) {
@Override
protected void handlePaymentIntent(final PaymentIntent paymentIntent) {
cannotClassify(inputType);
}
@Override
protected void error(final int messageResId, final Object... messageArgs) {
final DialogBuilder dialog = DialogBuilder.dialog(WalletActivity.this, 0, messageResId, messageArgs);
dialog.singleDismissButton(null);
dialog.show();
}
}.parse();
}
}
Aggregations