How can I save playing media state when the window rotating by user ?
Asked
Active
Viewed 212 times
2 Answers
2
With onSaveInstanteState
, like you always do for Saving Android Activity state using Save Instance State
This also means that you need to keep track of the MediaPlayerService state yourself, since there is no way to get the state of the media player.
1
You may follow this link in order to stop refreshing the activity on orientation change:
-
There are many answers to this question. If you are referring to `android:configChanges`, this goes against the philosophy of the framework, and I would not recommend this option. From the [Android dev guide](http://developer.android.com/guide/topics/manifest/activity-element.html#config): *Using this attribute should be avoided and used only as a last-resort. Please read [Handling Runtime Changes](http://developer.android.com/guide/topics/resources/runtime-changes.html) for more information about how to properly handle a restart due to a configuration change.* – rds Oct 15 '12 at 10:49