]> www.average.org Git - YkNeoCR.git/blobdiff - src/org/average/nfcauthcr/Check.java
move swipeDialog to activity
[YkNeoCR.git] / src / org / average / nfcauthcr / Check.java
index 1fc5ceaf00f36d497b5cae113390f2361d4d7bf6..6b6ec4f568f79e043ea47cef0888432bb38257b4 100644 (file)
@@ -20,7 +20,6 @@ public class Check extends Activity {
 
        private final String TAG = getClass().getName();
 
-       private AlertDialog swipeDialog;
        private PendingIntent tagIntent;
 
        @Override
@@ -30,14 +29,8 @@ public class Check extends Activity {
 
                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);
                }
        }
@@ -47,10 +40,6 @@ public class Check extends Activity {
                super.onPause();
                Log.v(TAG, "Finished the work");
 
-               if(swipeDialog != null) {
-                       swipeDialog.dismiss();
-                       swipeDialog = null;
-               }
                disableDispatch();
        }
 
@@ -76,18 +65,26 @@ public class Check extends Activity {
                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();
@@ -101,13 +98,11 @@ public class Check extends Activity {
                        Toast.makeText(this, R.string.no_nfc,
                                                Toast.LENGTH_LONG).show();
                        finish();
-                       return;
                }
                if (! adapter.isEnabled()) {
                        Toast.makeText(this, R.string.nfc_disabled,
                                                Toast.LENGTH_LONG).show();
                        finish();
-                       return;
                }
                adapter.enableForegroundDispatch(
                        this, tagIntent, new IntentFilter[] {iso},