How does my android activity knows when the device changes in orientation
Can you please tell me how do开发者_如何学Goes my android activity know (is there a callback) when there is a change in screen orientation?
Thank you.
Take a look at Activity
's public void onConfigurationChanged(Configuration newConfig)
method:
http://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged%28android.content.res.Configuration%29
Watch out for this:
Note that this will only be called if you have selected configurations you would like to handle with the configChanges attribute in your manifest.
精彩评论