[Android] TV: (un)register receiver in onStart/onStop

Geoffrey Métais git at videolan.org
Thu Jul 6 16:51:41 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jul  6 15:14:46 2017 +0200| [9aa7a2d6623a203b4b17101c7a5cb3ead3358817] | committer: Geoffrey Métais

TV: (un)register receiver in onStart/onStop

Fixes MediaparsingService events not received

> https://code.videolan.org/videolan/vlc-android/commit/9aa7a2d6623a203b4b17101c7a5cb3ead3358817
---

 .../src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
index 4a4e5bef7..eb3a98be5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
@@ -67,8 +67,8 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
     }
 
     @Override
-    protected void onResume() {
-        super.onResume();
+    protected void onStart() {
+        super.onStart();
         mIsVisible = true;
         //Handle network connection state
         IntentFilter networkFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
@@ -87,9 +87,9 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
     }
 
     @Override
-    protected void onPause() {
+    protected void onStop() {
         mIsVisible = false;
-        super.onPause();
+        super.onStop();
         unregisterReceiver(mExternalDevicesReceiver);
         LocalBroadcastManager.getInstance(this).unregisterReceiver(mParsingServiceReceiver);
     }



More information about the Android mailing list