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?