0

This is my manifest.xml code:

<activity
    android:name="com.example.SearchActivity"
    android:noHistory="true"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:screenOrientation="portrait" >
</activity>

And i have added the follwoing code in my activity :

@Override
    public void onConfigurationChanged(Configuration newConfig) {
      // ignore orientation/keyboard change
      super.onConfigurationChanged(newConfig);
    }

Though i have done this two things my device is changing its oreientaion whenever it's go from portrait to landscape and vice versa. I want to lock it only to portrait view. But it is not doing that. What things should i change here.

Developer
  • 385
  • 1
  • 3
  • 18
  • possible duplicate of [Android - disable landscape mode?](http://stackoverflow.com/questions/582185/android-disable-landscape-mode) – Klapsa2503 Oct 22 '14 at 16:02
  • remove `android:configChanges` `android:screenOrientation="portrait"` this will do. – Rustam Oct 22 '14 at 16:06
  • Rustam i have removed andorid:configChanges from manifest now only android:screenOrientation tehre. BUt still the problem exist. – Developer Oct 22 '14 at 16:51

0 Answers0