@Override public void onClick(DialogInterface dialog, int which) { setResult(RESULT_CANCELED); finish(); }
/** * Finishes the activity (with scan results if scan result listener is not set). */ private void finishWithResults() { Intent intent = new Intent(); setResult(RESULT_OK, intent); mRecognizerBundle.saveToIntent(intent); finish(); }