title: i want to make my application only in landscape in android
body: <p>I want to make my app work only in landscape mode but can't make it work. I have given <code>screenOrientation = "landscape"</code> even though the first page will be in landscape mode and other activity will be in portrait. </p>
  
  <p><strong>XML FILE</strong></p>
  
  <pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
      &lt;activity android:name=".Main"
                android:label="@string/app_name"
                android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;     
  
      &lt;/activity&gt;
  
      &lt;activity android:name=".IntroHome"
                android:label="@string/app_name"
                android:screenOrientation="landscape"&gt;
      &lt;/activity&gt;
  
      &lt;activity android:name=".ObjectivesPage"
                android:label="@string/app_name"
                android:screenOrientation="landscape" &gt;
      &lt;/activity&gt;
  
      &lt;activity android:name=".MenuPage"
                android:label="@string/app_name"
                android:screenOrientation="landscape" &gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>
   </p>
  
  <p><strong>JAVA CLASS</strong></p>
  
  <pre><code>public class ObjectivesPage extends Activity{
  
      ImageButton  imgButton;
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.objectivespage);
          setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
  
          imgButton = (ImageButton)findViewById(R.id.buttonCloseNGo);
          imgButton.setOnClickListener(onClickCloseNGo);
      }
  
      private OnClickListener onClickCloseNGo = new OnClickListener(){
  
          public void onClick(View v) {
              Intent intent = new Intent(ObjectivesPage.this,MenuPage.class);
              startActivity(intent);
          }
      };
  }
  </code></pre>