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
I faced this problem only in SDK 26 (8.0.0) if using windowIsTranslucent 'true' and forcefully setting orientation:
Here's the solution:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
// fixing portrait mode problem for SDK 26 if using windowIsTranslucent = true
if (Build.VERSION.SDK_INT == 26) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}