Audioplayer didn't always restore its state correctly
This commit is contained in:
parent
565ff19510
commit
c11288fcdb
|
@ -52,6 +52,8 @@ public class AudioplayerActivity extends MediaplayerActivity {
|
||||||
|
|
||||||
private Fragment currentlyShownFragment;
|
private Fragment currentlyShownFragment;
|
||||||
private int currentlyShownPosition = -1;
|
private int currentlyShownPosition = -1;
|
||||||
|
/** Used if onResume was called without loadMediaInfo. */
|
||||||
|
private int savedPosition = -1;
|
||||||
|
|
||||||
private TextView txtvTitle;
|
private TextView txtvTitle;
|
||||||
private TextView txtvFeed;
|
private TextView txtvFeed;
|
||||||
|
@ -131,6 +133,7 @@ public class AudioplayerActivity extends MediaplayerActivity {
|
||||||
}
|
}
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
|
savedPosition = currentlyShownPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -213,6 +216,10 @@ public class AudioplayerActivity extends MediaplayerActivity {
|
||||||
true);
|
true);
|
||||||
startService(launchIntent);
|
startService(launchIntent);
|
||||||
}
|
}
|
||||||
|
if (savedPosition != -1) {
|
||||||
|
switchToFragment(savedPosition);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue