Check orientation on Android phone

前端 未结 23 1908
庸人自扰
庸人自扰 2020-11-22 06:26

How can I check if the Android phone is in Landscape or Portrait?

23条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 07:10

    Use getResources().getConfiguration().orientation it's the right way.

    You just have to watch out for different types of landscapes, the landscape that the device normally uses and the other.

    Still don't understand how to manage that.

提交回复
热议问题