我在横屏的情况点击一张图片进入一个activity(调用下面的函数),然后立即将平板切换成竖屏,平板屏幕会黑一下屏,然后才显示下一个activity的view,并且此时view得到的配置是横屏的配置。两个activity的View的onCongigurationChange函数都没有被调用,我的屏幕已经是竖屏了,但是我用Configuration得到的屏幕信息仍然是横屏 public void showReader(ChannelModel channelModel) {
Configuration config = this.getResources().getConfiguration();
Log.e("heng", ""+config.orientation);
Intent intent = new Intent(this, ArticleReaderLayoutActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
Bundle mBundle = new Bundle();
mBundle.putSerializable("channelModel", channelModel);
intent.putExtras(mBundle);
this.startActivity(intent);
this.finish();
this.overridePendingTransition(R.anim.push_left_in,
R.anim.push_left_out);
}
Configuration config = this.getResources().getConfiguration();
Log.e("heng", ""+config.orientation);
Intent intent = new Intent(this, ArticleReaderLayoutActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
Bundle mBundle = new Bundle();
mBundle.putSerializable("channelModel", channelModel);
intent.putExtras(mBundle);
this.startActivity(intent);
this.finish();
this.overridePendingTransition(R.anim.push_left_in,
R.anim.push_left_out);
}
解决方案 »
- 项目已部署就报空指针
- 使用setProgressDrawable()动态替换ProgressDrawable图片不好用
- No content provider found for permission revoke: file://XXX.apk是什么意思?
- android ==号没用????不会把 怎么回事
- 有多个activity,manifest文件的activity怎么设置
- VMRuntime 找不到trackExternalAllocation,trackExternalFree方法
- 怎么给TextView 加上双击事件?
- 求助做过安卓手电筒的各位大神
- 把JAVA程序制作成ANDROID程序.apk
- android OkHttpUtils网络延迟多次请求接口
- 请教高手一个有关状态栏的问题!!!!!!!!
- 和高手探讨下Android项目的SVN管理!
this.startActivity(intent);
this.finish();
this.overridePendingTransition(R.anim.push_left_in,
R.anim.push_left_out);
}
这个在前面已经调用了finish()了,后面还可以执行
this.overridePendingTransition(R.anim.push_left_in,
R.anim.push_left_out);吗?
public void overridePendingTransition (int enterAnim, int exitAnim) Call immediately after one of the flavors of startActivity(Intent) or finish() to specify an explicit transition animation to perform next.可以在startActivity 或者在finish之后指定