Search code examples
androidandroid-fragmentssurfaceviewscreen-orientation

Video Starts Over using SurfaceView when rotating


When I rotate the screen my video starts over. I am using surfaceview. This is all handled in fragments. I have set android:configChanges="orientation" in my manifest. This is what I have added

    <activity
        android:name=".BassActivity"
        android:configChanges="orientation"
        >

I have also added this in onCreate:

@Override
public void onCreate(Bundle savedInstanceState) {
    if (VERBOSE) Log.v(TAG, "+++ onCreate +++");
    super.onCreate(savedInstanceState);
    setRetainInstance(true);

Nothing seems to change. Any help will be greatly appreciated.


Solution

  • Do this way

    <activity
            android:name=".BassActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            >