[Android] Unregister callbacks on disconnect

Geoffrey Métais git at videolan.org
Wed Nov 23 15:20:40 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov 22 18:12:17 2016 +0100| [dcb0c7340f0d18165eaed3d8eea7dd371c12de65] | committer: Geoffrey Métais

Unregister callbacks on disconnect

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

 vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index e29c122..9f2d150 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -180,9 +180,13 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
     }
 
     @Override
+    public void onDisconnected() {
+        mService.removeCallback(this);
+        super.onDisconnected();
+    }
+
+    @Override
     protected void onStop() {
-        if (mService != null)
-            mService.removeCallback(this);
         super.onStop();
         if (AndroidDevices.isAndroidTv()) {
             Intent recommendationIntent = new Intent(this,



More information about the Android mailing list