- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- // Checks the orientation of the screen
- if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
- Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show();
- } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
- Toast.makeText(this, "portrait", Toast.LENGTH_SHORT).show();
- }
- }
横竖屏切换监听 android
最新推荐文章于 2024-04-01 16:10:26 发布