Question

I want to disable the orientation changes from portrait to landscape change while camera and photo gallery running in android. I am searching through the google but there is no use.

Was it helpful?

Solution

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

or

<activity
    android:name=".MainActivity"
    android:screenOrientation="portrait" >
</activity>

OTHER TIPS

Do this on your camera activity

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top