<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">NFC Auth</string>
- <string name="enroll">Enroll</string>
- <string name="select_slot">Select Slot</string>
- <string name="slot_1">Slot 1</string>
- <string name="slot_2">Slot 2</string>
+ <string name="app_name">NFC Auth</string>
+ <string name="enroll">Enroll</string>
+ <string name="select_slot">Select Slot</string>
+ <string name="slot_1">Slot 1</string>
+ <string name="slot_2">Slot 2</string>
+ <string name="enrollresult">Enrollment result:</string>
</resources>
import android.os.Bundle;
import android.app.Activity;
+import android.app.AlertDialog;
import android.preference.PreferenceManager;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
+import android.content.DialogInterface;
import android.util.Log;
import android.view.View;
+import android.widget.TextView;
import android.widget.RadioButton;
public class NFCAuthCREnroll extends Activity
public void onEnrollClicked(View view) {
Log.v(TAG, "Enroll clicked");
- if (!waitingForResult) { finish(); }
+ if (slot > 0) {
+ showEnrollResult("<FIXME> using slot" + slot);
+ } else {
+ showEnrollResult("Must specify which slot to use");
+ }
+ }
+
+ private void showEnrollResult(final String msg) {
+ Log.v(TAG, "Show result: \"" + msg + "\"");
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(R.string.enrollresult);
+ builder.setMessage(msg);
+ builder.setPositiveButton(android.R.string.ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ dialog.dismiss();
+ if (!waitingForResult) { finish(); }
+ }
+ });
+ AlertDialog dialog = builder.create();
+ dialog.show();
}
}