fix #4238
This commit is contained in:
@@ -400,12 +400,15 @@ class ElectrumWindow(App):
|
|||||||
intent = Intent(PythonActivity.mActivity, SimpleScannerActivity)
|
intent = Intent(PythonActivity.mActivity, SimpleScannerActivity)
|
||||||
|
|
||||||
def on_qr_result(requestCode, resultCode, intent):
|
def on_qr_result(requestCode, resultCode, intent):
|
||||||
if resultCode == -1: # RESULT_OK:
|
try:
|
||||||
# this doesn't work due to some bug in jnius:
|
if resultCode == -1: # RESULT_OK:
|
||||||
# contents = intent.getStringExtra("text")
|
# this doesn't work due to some bug in jnius:
|
||||||
String = autoclass("java.lang.String")
|
# contents = intent.getStringExtra("text")
|
||||||
contents = intent.getStringExtra(String("text"))
|
String = autoclass("java.lang.String")
|
||||||
on_complete(contents)
|
contents = intent.getStringExtra(String("text"))
|
||||||
|
on_complete(contents)
|
||||||
|
finally:
|
||||||
|
activity.unbind(on_activity_result=on_qr_result)
|
||||||
activity.bind(on_activity_result=on_qr_result)
|
activity.bind(on_activity_result=on_qr_result)
|
||||||
PythonActivity.mActivity.startActivityForResult(intent, 0)
|
PythonActivity.mActivity.startActivityForResult(intent, 0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user