Skip to content

Instantly share code, notes, and snippets.

@isaidamier
Created September 5, 2017 22:28
Show Gist options
  • Save isaidamier/bbd3b394265f31f5657c4ad7d0a661ef to your computer and use it in GitHub Desktop.
Save isaidamier/bbd3b394265f31f5657c4ad7d0a661ef to your computer and use it in GitHub Desktop.
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putLong(POS_KEY, player.getCurrentPosition());
super.onSaveInstanceState(outState);
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
long position = savedInstanceState.getLong(POS_KEY);
player.seekTo(position);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment