X-Git-Url: http://www.average.org/gitweb/?p=YkNeoCR.git;a=blobdiff_plain;f=src%2Forg%2Faverage%2Fnfcauthcr%2FTagEvent.java;fp=src%2Forg%2Faverage%2Fnfcauthcr%2FTagEvent.java;h=0000000000000000000000000000000000000000;hp=febfa63fc9914e14089915e06130c3ecba4881c3;hb=0c96e6ff75abc6adfa713c00963fd14f5de2f34c;hpb=08b05b67a65e78e80fb0fffec8855a69a72ebff9 diff --git a/src/org/average/nfcauthcr/TagEvent.java b/src/org/average/nfcauthcr/TagEvent.java deleted file mode 100644 index febfa63..0000000 --- a/src/org/average/nfcauthcr/TagEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.average.nfcauthcr; - -import android.app.Activity; -import android.app.AlertDialog; -import android.app.PendingIntent; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.IntentFilter; -import android.nfc.NfcAdapter; -import android.nfc.Tag; -import android.nfc.TagLostException; -import android.nfc.tech.IsoDep; -import android.util.Log; -import android.widget.Toast; - -import org.average.nfcauthcr.NfcCRdispatch; - -public class TagEvent extends Activity { - - private final String TAG = getClass().getName(); - - private NfcCRdispatch dispatch = new NfcCRdispatch((Activity)this); - - @Override - protected void onResume() { - super.onResume(); - Log.v(TAG, "Starting the work"); - - new AlertDialog.Builder(this) - .setTitle(R.string.challenging) - .setMessage(R.string.swipe) - .setOnCancelListener( - new DialogInterface.OnCancelListener() { - public void onCancel(DialogInterface dialog) { - Log.v(TAG, "Cancel"); - finish(); - } - }) - .create().show(); - - Intent intent = getIntent(); - setResult(RESULT_CANCELED); - byte[] challenge = intent.getByteArrayExtra("challenge"); - dispatch.onResume(challenge); - } - - @Override - protected void onPause() { - super.onPause(); - Log.v(TAG, "Finished the work"); - - dispatch.onPause(); - } - - public void onNewIntent(Intent newintent) { - Log.v(TAG, "NFC Intent arrived"); - - byte[] response = dispatch.onNewIntent(newintent); - if (response != null) { - Intent masterintent = getIntent(); - masterintent.putExtra("response", response); - setResult(RESULT_OK, masterintent); - finish(); - } - } -}