Wednesday, July 31, 2013

Show Activity in Portrait or Landscape mode only

In Android, some times  we need to show an Activity/Screen in portrait or Landscape mode only. Specially while developing game, we want a particular game to be played in Landscape or Portfrait mode only.

for this we need to set the  android:screenOrientation  attribute in manifest

To show the Screen/Activity in Landscape mode only

 <activity android:name=".MainActivity"

To show the Screen/Activity in Portrait mode only.

 <activity android:name=".MainActivity"


  1. thnak you.. Exactly what was I want.

  2. Dear, I like your blog very much, I can get many useful information. Hope that we can communicate with each other. By the way, have you ever used resize server 2003 boot partition ? Unfortunately I lost my partition. I do not know how to do.

  3. Their utilization of plants is frequently extremely normal and tedious and their structures can be deadened - however there are special cases. click here