Commit 95a0f827 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

Save and load last tab state

Sorry, fixed a small overlook in onSaveInstanceState().
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent a6149222
......@@ -91,8 +91,12 @@ public class MainActivity extends TabActivity {
Log.d(TAG, "Started from notification.");
showAudioTab();
} else {
// TODO: load the last tab-state
showVideoTab();
// load the last tab-state
int state = savedInstanceState == null ? VIDEO_TAB : savedInstanceState.getInt("mCurrentState");
if(state == VIDEO_TAB)
showVideoTab();
else
showAudioTab();
}
/* Show info/alpha/beta Warning */
......@@ -129,6 +133,15 @@ public class MainActivity extends TabActivity {
return false;
}
/**
* Save currently opened tab (video/audio) for above
*/
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
savedInstanceState.putInt("mCurrentState", mCurrentState);
super.onSaveInstanceState(savedInstanceState);
}
/**
* Handle onClick form menu buttons
*/
......
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