[Android] Improve TV launch
Geoffrey Métais
git at videolan.org
Wed Jan 11 17:56:15 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan 11 17:55:33 2017 +0100| [770d92eda325b5cd55994592590bdc08d023974f] | committer: Geoffrey Métais
Improve TV launch
> https://code.videolan.org/videolan/vlc-android/commit/770d92eda325b5cd55994592590bdc08d023974f
---
vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java | 5 +++--
1 file changed, 3 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 374cc52..d3d272d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -167,7 +167,7 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
/*
* skip browser and show directly Audio Player if a song is playing
*/
- if ((mRowsAdapter == null || mRowsAdapter.size() == 0) && Permissions.canReadStorage())
+ if (mMediaLibrary.isInitiated() && (mRowsAdapter == null || mRowsAdapter.size() == 0) && Permissions.canReadStorage())
update();
else {
updateBrowsers();
@@ -210,9 +210,9 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
mService.addCallback(this);
if (mMediaLibrary.isInitiated()) {
setmedialibraryListeners();
+ update();
} else
setupMediaLibraryReceiver();
- update();
}
@Override
@@ -597,6 +597,7 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
public void onReceive(Context context, Intent intent) {
LocalBroadcastManager.getInstance(MainTvActivity.this).unregisterReceiver(this);
setmedialibraryListeners();
+ update();
}
};
LocalBroadcastManager.getInstance(this).registerReceiver(libraryReadyReceiver, new IntentFilter(VLCApplication.ACTION_MEDIALIBRARY_READY));
More information about the Android
mailing list