private final String TAG = getClass().getName();
- private AlertDialog swipeDialog;
private PendingIntent tagIntent;
@Override
Intent intent = getIntent();
setResult(RESULT_CANCELED);
- if (swipeDialog != null) {
- swipeDialog.dismiss();
- swipeDialog = null;
- }
int slot = intent.getIntExtra("slot", -1);
if (slot > 0) {
- swipeDialog = makeDialog();
- swipeDialog.show();
enableDispatch(slot);
}
}
super.onPause();
Log.v(TAG, "Finished the work");
- if(swipeDialog != null) {
- swipeDialog.dismiss();
- swipeDialog = null;
- }
disableDispatch();
}
finish();
}
- private AlertDialog makeDialog() {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.challenging);
- builder.setMessage(R.string.swipe);
- builder.setOnCancelListener(
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- finish();
- }
- });
- return builder.create();
- }
+/*
+<receiver android:name=".IsoDepReceiver"
+ android:label="IsoDepReceiver">
+ <intent-filter>
+ <action android:name="android.nfc.action.TECH_DISCOVERED" />
+ </intent-filter>
+
+ <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
+ android:resource="@xml/filter_nfc"
+ />
+ </receiver>
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- capture anything using IsoDep -->
+ <tech-list>
+ <tech>android.nfc.tech.IsoDep</tech>
+ </tech-list>
+ </resources>
+
+*/
private void enableDispatch(int slot) {
Intent intent = getIntent();