java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation

前端 未结 30 1738
难免孤独
难免孤独 2020-12-02 04:43

I am facing the problem while retrieving the contacts from the contact book in Android 8.0 Oreo java.lang.IllegalStateException: Only fullscreen opaque activities can reques

30条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 05:35

    It is a conflict (bug) between Themes inside style.xml file in android versions 7 (Api levels 24,25) & 8 (api levels 26,27), when you have

    android:screenOrientation="portrait" :inside specific activity (that crashes) in AndroidManifest.xml

    &

    true 
    

    in the theme that applied to that activity inside style.xml

    It can be solve by these ways according to your need :

    1- Remove on of the above mentioned properties that make conflict

    2- Change Activity orientation to one of these values as you need : unspecified or behind and so on that can be found here : Google reference for android:screenOrientation `

    3- Set the orientation programmatically in run time

提交回复
热议问题