mirror of
https://github.com/zxing/zxing.git
synced 2024-09-19 21:17:33 -07:00
Minor revision to last change to Google Glass Intents
This commit is contained in:
parent
aedd6262e6
commit
f302d02ea1
1
AUTHORS
1
AUTHORS
|
@ -50,6 +50,7 @@ hosigumayuugi
|
||||||
hypest (Barcorama project)
|
hypest (Barcorama project)
|
||||||
Ian W. Davis
|
Ian W. Davis
|
||||||
Isaac Potoczny-Jones
|
Isaac Potoczny-Jones
|
||||||
|
Ivan Poliakov
|
||||||
Jacob Haynes (Google)
|
Jacob Haynes (Google)
|
||||||
Jeff Breidenbach (Google)
|
Jeff Breidenbach (Google)
|
||||||
Joan Montané (Softcatalà.cat)
|
Joan Montané (Softcatalà.cat)
|
||||||
|
|
|
@ -60,14 +60,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
||||||
|
|
||||||
// returnResult should be true if activity was started using
|
// returnResult should be true if activity was started using
|
||||||
// startActivityForResult() with SCAN_ACTION intent
|
// startActivityForResult() with SCAN_ACTION intent
|
||||||
returnResult = false;
|
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent != null) {
|
returnResult = intent != null && SCAN_ACTION.equals(intent.getAction());
|
||||||
String action = intent.getAction();
|
|
||||||
if (action != null)
|
|
||||||
returnResult = action.equals(SCAN_ACTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
Window window = getWindow();
|
Window window = getWindow();
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
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) {
|
void setResult(Result result) {
|
||||||
if (returnResult) {
|
if (returnResult) {
|
||||||
Intent scanResult = new Intent();
|
Intent scanResult = new Intent("com.google.zxing.client.android.SCAN");
|
||||||
scanResult.putExtra("SCAN_RESULT", result.getText());
|
scanResult.putExtra("SCAN_RESULT", result.getText());
|
||||||
setResult(RESULT_OK, scanResult);
|
setResult(RESULT_OK, scanResult);
|
||||||
finish();
|
finish();
|
||||||
|
|
Loading…
Reference in a new issue