Commit f521da35 authored by Geoffrey Métais's avatar Geoffrey Métais

Load library when medialib items list is empty

parent 30007fba
......@@ -136,7 +136,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements OnItem
}
mMediaLibrary = MediaLibrary.getInstance();
if (savedInstanceState == null) { // means first creation, savedInstanceState is not null after rotation
if (mMediaLibrary.getMediaItems().isEmpty()) { // means first creation, savedInstanceState is not null after rotation
/* Load media items from database and storage */
mMediaLibrary.loadMediaItems();
}
......
......@@ -41,14 +41,6 @@ public abstract class MediaBrowserFragment extends PlaybackServiceFragment {
mMediaLibrary = MediaLibrary.getInstance();
}
@Override
public void onViewStateRestored(Bundle savedInstanceState) {
super.onViewStateRestored(savedInstanceState);
if (MediaLibrary.getInstance().getMediaItems().isEmpty()) {
mMediaLibrary.loadMediaItems();
}
}
public void setReadyToDisplay(boolean ready) {
if (ready && !mReadyToDisplay)
display();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment