I wanted to fix screen orientation as a landscape mode in tab i.e on 7″
I am calculating the inch of the device in my coding and is setting it as:
int inch=((int)height_pixel1/(int)xdpi);
if(inch>=6){
orientation=true;
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
orientation=false;
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
and the problem is firstly it displays me the screen orientation as according to my requirement,but when processing is going on in between , then it changes the orientation as portrait way and again in landscape way.. It is still toggle between these two orientation and I want to make a fixed orienattion for my whole application…Is there any property that I am missing here??
Create a folder layout-xlarge-land and put your XML in it… it should be designed for landsacpe screen.. also You have to give
Refer
http://developer.android.com/guide/topics/resources/providing-resources.html