2

I add the following line to my Activity in the Android manifest

 android:screenOrientation="nosensor"

then I add the below code to onCreate() in my Java class

 if (isSmartphone(this))
    {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }
 else
    {
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    }

But in the Kindle Fire devices it's not setting the orientation. Does anyone know how to fix this issue?

Matthias
  • 17
  • 4
Imeshke
  • 811
  • 6
  • 13
  • In menifest change like that orientation android:screenOrientation="portrait" – Sunil Kumar May 15 '13 at 05:17
  • thanks.. but I need both orientations. if the device is Smart Phone the orientation should be portrait. if it is a tab the orientation should be landscape.. This is working fine except kindle fire devices – Imeshke May 15 '13 at 05:23
  • You will also need to declare the android.permission.WRITE_SETTINGS and possibly the android.permission.WRITE_SECURE_SETTINGS permissions in your manifest. – Sunil Kumar May 15 '13 at 05:27
  • I think this is what you were looking for: http://stackoverflow.com/a/20714828/1807627 – Leo Landau Mar 10 '14 at 19:44

0 Answers0