-
-
Save JigarM/5657122 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| qrScanButton.addEventListener("click", function(e) { | |
| var intent = Ti.Android.createIntent({ | |
| action: "com.google.zxing.client.android.SCAN" | |
| }); | |
| intent.putExtra("SCAN_MODE", "QR_SCAN_MODE"); | |
| var activity = Ti.Android.currentActivity; | |
| activity.startActivityForResult(intent, function(e) { | |
| if (e.resultCode == Ti.Android.RESULT_OK) { | |
| var contents = e.intent.getStringExtra("SCAN_RESULT"); | |
| var format = e.intent.getStringExtra("SCAN_RESULT_FORMAT"); | |
| Ti.UI.createNotification({ | |
| message: "Contents: " + contents + ", Format: " + format | |
| }).show(); | |
| } else if (e.resultCode == Ti.Android.RESULT_CANCELED) { | |
| Ti.UI.createNotification({ | |
| message: "Scan canceled!" | |
| }).show(); | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment