I have a one condition. There is a SDK in my Project.who change activity orientation when it requires the performing an operation. But after its operation i have to set activity orientation according to the device orientation.
I used following method to set screen orientation back to previous orientation. But when i set it. Next time if i rotate my device my activity is not changing orientation according to the device.
Can anyone suggest me the proper solution to make my activity flexible again. Or solving this situation. Thanks In advance.
if(this.getResource开发者_Go百科s().getConfiguration().orientation !=Configuration.ORIENTATION_PORTRAIT)
{
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
When device rotates the your activity will take take it's orientation according to the device but if set it's orientation then it will not change with device orientation.
refer this blog:
http://android-developers.blogspot.com/2009/02/faster-screen-orientation-change.html
精彩评论