I am trying to understand the Camera app that comes pre-installed on my Samsung Galaxy Note 2. It makes use of a SurfaceView and button widgets overtop of it.
As far as i can tell it is fixed in the Landscape mode however when i rotate the device to portrait the button widgets rotate around to display in the correct orientation though the camera preview remains in its landscape mode.
How did they achieve that? I mean, for my app i've added the following to my manifest:
[HIGH]
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="16" />
...
<activity android:name="com.example.cameratest.CameraActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|screenSize"></activity>
[/HIGH]
And within my activity i have:
[HIGH]@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
....
}
[/HIGH]
I was expecting the screen to remain fixed in landscape but will get some event indicating the device has rotated from Landscape to Portrait within the onCofigurationChanged function but it is NEVER called. It seems the only time it is called is when i remove screenOrientation. The problem then is the view will never remain fixed in landscape.
What am i doing wrong?
As far as i can tell it is fixed in the Landscape mode however when i rotate the device to portrait the button widgets rotate around to display in the correct orientation though the camera preview remains in its landscape mode.
How did they achieve that? I mean, for my app i've added the following to my manifest:
[HIGH]
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="16" />
...
<activity android:name="com.example.cameratest.CameraActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|screenSize"></activity>
[/HIGH]
And within my activity i have:
[HIGH]@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
....
}
[/HIGH]
I was expecting the screen to remain fixed in landscape but will get some event indicating the device has rotated from Landscape to Portrait within the onCofigurationChanged function but it is NEVER called. It seems the only time it is called is when i remove screenOrientation. The problem then is the view will never remain fixed in landscape.
What am i doing wrong?