My code to set screen orientation for my application is not working my phone hang ??
Display display = getWindowManager().getDefaultDisplay();
float width = display.getWidth();
float height = display.getHeight();
if (width>height)
{
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
else setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
// then
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
EDIT 1 : Solved
and also can i prevent the content to reload on screen rotation?
EDIT 2 :
CAn i prevent activity to reload when call is recieved specially problem is with list view it just flushed.
Please answer Edit 2
My criteria with answer someups to