I have a video player implemented in an activity. I am forcing it into landscape at this stage by doing setting up the manifest like this
<activity android:name=".activity.VideoPlayerActivity"
android:launchMode="singleTask"
android:configChanges="orientation"
android:screenOrientation="landscape"/>
and overriding onConfigurationChanged with an empty implementation so that the activity is not restarted.
This all works great but at least on the emulator it seems to affect other activities forcing them into landscape even though they share nothing in terms of code. I have no seen this happen on any phone yet but obviously I have a limited amount of phones and I would really not like this to happen to users.
So has anybody seen this problem before? Is it just the emulator? Is there maybe a better way to do it?
Or considering tablets and so on coming along should I stop to force landscape mode anyway and just keep track of the position in the video and restart at the right position upon orientation change?
I think that’s an emulator thing; I’m sure I’ve seen similar, but never on any phone.
Also, your
Activitycan be restarted by various configChanges, including a hardware keyboard sliding in/out, or change of locale, or day/night mode?Best to allow the user to choose and keep track of the position, like you say.
Maybe you can even hold onto the MediaPlayer (or whatever) you’re using via
onRetainNonConfigurationInstance().