Check orientation on Android phone

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

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

23条回答
  •  北海茫月
    2020-11-22 07:15

    The Android SDK can tell you this just fine:

    getResources().getConfiguration().orientation
    

提交回复
热议问题