i want to make my application only in landscape in android
Keep this part of the manifest as it already is. For example, consider the IntroHome activity.
<activity android:name=".IntroHome" android:label="@string/app_name" android:screenOrientation="landscape" ></activity>
And for the activity XML, make sure you have the IntroHome activity layout XML only in the layout-land folder. This way, the activity / activities you have will only show the the landscape version of the XML that you have defined.
You can also try setting the orientation from your code
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
Check this link for more info
You can use following code as per requirement:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
andsetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
you have to put these code before setContentView(R.layout.layout_name.xml)
.