我在横屏的情况点击一张图片进入一个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);
}
解决方案 »
- 关于布局的一个小问题向大家请教下
- 在Android上开发音频软件的一些想法,求助。
- android如何从服务器上循环解析图片
- 有一个布局的实现提供源代码(有图)
- Eclipse开发android软件,各部分代码都没有错误,可是project文件夹旁显示叉叉
- 用eclipse编写android代码,没有错误,但是运行时程序异常,强制终止,求高手指点
- 求助:在android布局是全屏的情况下, 如何监听软键盘的弹出和隐藏,有好的方法直接给100分!!!
- android照片分享
- 在手机浏览器中获取GPS坐标准确吗?
- sos 怎么在代码里设置将一个imagebutton放在屏幕的中间
- 请教高手一个有关状态栏的问题!!!!!!!!
- 和高手探讨下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之后指定