Upon creation of the new Activity when rotation is completed I load
the current playtime by calling:
playTime=((Integer)getLastNonConfigurationInstance()).intValue();
Now I want to restart the MediaPlayer automatically, playing at the
latest stored position, without having to press my "play" button. The
problem I have is that I do not know how to figure out when the
Activity is finished and when it is legal to call
MediaPlayer.start();
I have tried to override the onResume() method and calling start
there, but this fails with an exception indicating that
MediaPlayer.start(); is called in the wrong state.
The same error comes if I try to start in onCreate() and onStart(). :
ERROR/MediaPlayer(10655): start called in state 1
Can anyone help me out a bit here so I will be able to restore my
player automatically?