1
0

android: fix back button not working (main surface loses focus)

fixes #6276
This commit is contained in:
SomberNight
2020-07-03 09:07:21 +02:00
parent 8d7370d897
commit da4edc8f74
2 changed files with 14 additions and 1 deletions

View File

@@ -849,6 +849,17 @@ class ElectrumWindow(App):
return
self.use_change = self.wallet.use_change
self.electrum_config.save_last_wallet(wallet)
self.request_focus_for_main_view()
def request_focus_for_main_view(self):
if platform != 'android':
return
# The main view of the activity might be not have focus
# in which case e.g. the OS "back" button would not work.
# see #6276 (specifically "method 2" and "method 3")
from jnius import autoclass
PythonActivity = autoclass('org.kivy.android.PythonActivity')
PythonActivity.requestFocusForMainView()
def update_status(self, *dt):
if not self.wallet: