I have an activity which shows a full screen videoView (yet maintain the aspect ratio). It worked perfectly on Android 2.3.7, but i'm having some weird problems on Android 4 (and probably 3, i didn't check yet):
For some reason, if I set the theme to be full screen, without the titlebar (or action bar), i get a blue-ish (or white-ish?) gradient below the videoView, as shown here:
The relevant layout is here:
edit: on android 3 , it doesn't occur.
When I change the orientation from portrait to landscape, it re-loads the whole video from the beginning. On Android 2.3.7, it continued without any delay, as if nothing has changed.
The relevant manifest part is here:
<activity android:name=".activities.player_activity.PlayerActivity" android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" android:screenOrientation="sensor"/>
Note that on Android 3, rotating the tablet doesn't do anything, so there is no orientation change.
How should I handle those problems ? The API demos don't seem to be updated to handle those cases.
My project was tested on: nexus one (android 2.3.7) , xoom (android 3) , galaxy S3 (android 4).
In order to fix number 1, I've simply changed the theme that doesn't have any background. Odd that it's this way on the device. Wonder if it's like this on other Android 4 devices. In order to create the theme, I've created a file "theme.xml" in the "res/values/" folder, and wrote there:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.FullScreenNobarsNoBackground" parent="@android:style/Theme.Holo.NoActionBar.Fullscreen">
<item name="android:windowBackground">@null</item>
</style>
</resources>
Of course I've also updated the manifest to use the new theme.