Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- checkOrientation(newConfig);
- }
- private void checkOrientation(Configuration newConfig){
- // Checks the orientation of the screen
- if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
- Log.d("OrientationMyApp", "Current Orientation : Landscape");
- // Your magic here for landscape mode
- } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
- Log.d("OrientationMyApp", "Current Orientation : Portrait");
- // Your magic here for portrait mode
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement