[Android] Register Monitor once it's created
Geoffrey Métais
git at videolan.org
Mon Nov 12 17:27:18 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov 12 16:56:25 2018 +0100| [c1302698469cf08b4d26a6c26fe55cc533af451c] | committer: Geoffrey Métais
Register Monitor once it's created
> https://code.videolan.org/videolan/vlc-android/commit/c1302698469cf08b4d26a6c26fe55cc533af451c
---
vlc-android/src/org/videolan/vlc/ExternalMonitor.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/ExternalMonitor.java b/vlc-android/src/org/videolan/vlc/ExternalMonitor.java
index ac1b398d4..5da9721fc 100644
--- a/vlc-android/src/org/videolan/vlc/ExternalMonitor.java
+++ b/vlc-android/src/org/videolan/vlc/ExternalMonitor.java
@@ -75,7 +75,12 @@ public class ExternalMonitor extends BroadcastReceiver implements LifecycleObser
public static LiveDataset<UsbDevice> devices = new LiveDataset<>();
public ExternalMonitor() {
- ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ ProcessLifecycleOwner.get().getLifecycle().addObserver(instance);
+ }
+ });
}
@OnLifecycleEvent(Lifecycle.Event.ON_START)
More information about the Android
mailing list