Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. //this is called when the screen rotates.
  2. // (onCreate is no longer called when screen rotates due to manifest, see: android:configChanges)
  3. @Override
  4. public void onConfigurationChanged(Configuration newConfig)
  5. {
  6. super.onConfigurationChanged(newConfig);
  7. int orientation = newConfig.orientation;
  8. if (orientation == Configuration.ORIENTATION_PORTRAIT)
  9. {
  10. Log.d("tag", "Portrait");//Do your layout changes here
  11. }
  12. else if (orientation == Configuration.ORIENTATION_LANDSCAPE)
  13. {
  14. Log.d("tag", "Landscape");//Do your layout changes here
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement