Android的方向 [英] orientation android

查看:260
本文介绍了Android的方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序添加,但方向我需要 - >当我的肖像风格的手机作品活动,当我改变肖像风格的景观风格的活动停止后,我B活性starts.How可以处理这个问题?谢谢...


解决方案

 如果(getResources()。getConfiguration()。方向== Configuration.ORIENTATION_PORTRAIT)
{}
如果(getResources()。getConfiguration()。方向== Configuration.ORIENTATION_LANDSCAPE)
{}

I want to add orientation on my app but I need that--> when my phone on PORTRAIT style works A activity and when I change PORTRAIT style as LANDSCAPE style A activity stops and B activity starts.How can I handle this? Thanks...

解决方案

if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
{   

}
if (getResources().getConfiguration().orientation ==Configuration.ORIENTATION_LANDSCAPE)
{   

} 

这篇关于Android的方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆