Minor revision to last change to Google Glass Intents

This commit is contained in:
Sean Owen 2014-05-20 20:54:58 +01:00
parent aedd6262e6
commit f302d02ea1
2 changed files with 3 additions and 8 deletions

View file

@ -50,6 +50,7 @@ hosigumayuugi
hypest (Barcorama project)
Ian W. Davis
Isaac Potoczny-Jones
Ivan Poliakov
Jacob Haynes (Google)
Jeff Breidenbach (Google)
Joan Montané (Softcatalà.cat)

View file

@ -60,14 +60,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
// returnResult should be true if activity was started using
// startActivityForResult() with SCAN_ACTION intent
returnResult = false;
Intent intent = getIntent();
if (intent != null) {
String action = intent.getAction();
if (action != null)
returnResult = action.equals(SCAN_ACTION);
}
returnResult = intent != null && SCAN_ACTION.equals(intent.getAction());
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
@ -171,7 +165,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
void setResult(Result result) {
if (returnResult) {
Intent scanResult = new Intent();
Intent scanResult = new Intent("com.google.zxing.client.android.SCAN");
scanResult.putExtra("SCAN_RESULT", result.getText());
setResult(RESULT_OK, scanResult);
finish();