Commit fda7235a authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

MainActivity: call getFragment before restoring the view

Calling the getFragment method from SidebarAdapter after restoring the
view is wrong because it will replace the restored fragment by the last
instantiated one in the SidebarAdapter fragment factory.
parent ece06966
......@@ -280,6 +280,10 @@ public class MainActivity extends SherlockFragmentActivity {
AudioServiceController.getInstance().bindAudioService(this);
Boolean startFromNotification = getIntent().hasExtra(AudioService.START_FROM_NOTIFICATION);
/* Start the thumbnailer */
VideoListFragment f = (VideoListFragment)mSidebarAdapter.getFragment("video");
mThumbnailerManager.start(f);
/* Restore last view */
Fragment current = getSupportFragmentManager()
.findFragmentById(R.id.fragment_placeholder);
......@@ -307,10 +311,6 @@ public class MainActivity extends SherlockFragmentActivity {
if (startFromNotification)
getIntent().removeExtra(AudioService.START_FROM_NOTIFICATION);
/* Start the thumbnailer */
VideoListFragment f = (VideoListFragment)mSidebarAdapter.getFragment("video");
mThumbnailerManager.start(f);
super.onResume();
}
......
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