plugin android: use callFromThread instead of callLater:
`callLater` is not made to be called outside of main thread, `callFromThread` is the method to call in this case.
This commit is contained in:
parent
5cf43b2e2e
commit
47d258e841
1 changed files with 5 additions and 3 deletions
|
|
@ -309,9 +309,11 @@ class AndroidPlugin(object):
|
|||
# "XXX has no attribute 'invoke'" error (looks like the same issue as
|
||||
# https://github.com/kivy/pyjnius/issues/59)
|
||||
self.br = BroadcastReceiver(
|
||||
callback=lambda *args, **kwargs: reactor.callLater(0,
|
||||
self.onConnectivityChange),
|
||||
actions=["android.net.conn.CONNECTIVITY_CHANGE"])
|
||||
callback=lambda *args, **kwargs: reactor.callFromThread(
|
||||
self.onConnectivityChange
|
||||
),
|
||||
actions=["android.net.conn.CONNECTIVITY_CHANGE"]
|
||||
)
|
||||
self.br.start()
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Reference in a new issue