I have a video displayed using SurfaceView in a fragment. If I change the orientation of the screen while the video is playing it doesn't resize. For example, if the video is playing in landscape size (full screen), it doesn't go to portrait size when the screen is rotated. It remains if landscape size. If I start the video in landscape, it won't change to portrait.I am using the following in my manifest:
<activity
android:name=".BassActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
>
I have this in my "onCreate"
@Override
public void onCreate(Bundle savedInstanceState) {
if (VERBOSE) Log.v(TAG, "+++ onCreate +++");
super.onCreate(savedInstanceState);
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
setRetainInstance(true);
I would like for the video to re-size, for example from portrait to landscape when I rotate the screen, while it is playing.
I also added a toast message to onSurfaceChanged
to see when it is triggered,but it is not trigger when I rotate the screen. How can I re-size the video after it has started playing?