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
In android Oreo (API 26) you can not change orientation for Activity that have below line(s) in style
- true
or
- true
You have several way to solving this :
1) You can simply remove above line(s) (or turn it to false) and your app works fine.
2) Or you can first remove below line from manifest for that activity
android:screenOrientation="portrait"
Then you must add this line to your activity (in onCreate())
//android O fix bug orientation
if (android.os.Build.VERSION.SDK_INT != Build.VERSION_CODES.O) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
3) You can create new styles.xml in values-v26 folder and add this to your style.xml. (Thanks to AbdelHady comment)
- false
- false