[Android] Add isVisible() method to TV activities
Geoffrey Métais
git at videolan.org
Thu Apr 20 16:32:23 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Apr 20 16:31:30 2017 +0200| [971674dbae6bd6a7de2082e0a8705161557dd733] | committer: Geoffrey Métais
Add isVisible() method to TV activities
> https://code.videolan.org/videolan/vlc-android/commit/971674dbae6bd6a7de2082e0a8705161557dd733
---
.../src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java | 7 +++++++
1 file changed, 7 insertions(+)
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 3188398..79ad55a 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
@@ -52,6 +52,7 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
protected Medialibrary mMediaLibrary;
protected SharedPreferences mSettings;
boolean mRegistering = false;
+ private volatile boolean mIsVisible = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -63,6 +64,7 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
@Override
protected void onResume() {
super.onResume();
+ mIsVisible = true;
//Handle network connection state
IntentFilter networkFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
@@ -81,6 +83,7 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
@Override
protected void onPause() {
+ mIsVisible = false;
super.onPause();
unregisterReceiver(mExternalDevicesReceiver);
LocalBroadcastManager.getInstance(this).unregisterReceiver(mParsingServiceReceiver);
@@ -114,6 +117,10 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
}
};
+ protected boolean isVisible() {
+ return mIsVisible;
+ }
+
protected void onParsingServiceStarted() {}
protected void onParsingServiceFinished() {}
More information about the Android
mailing list