Open kelalaka153 opened 5 years ago
Please post the full stack trace and corresponding code in your Activity
class, so that we can understand the problem.
Note though, that material-intro does not need orientation to be locked, and that all standard slide styles come with landscape layouts too.
I'm using portrait mode in all of the activities. Material Intro version 1.6
also;
<style name="Theme.Intro" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
Process: com.xyz, PID: 21337 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xyz/com.xyz.firsttime.Welcome}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2820) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1596) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6565) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation at android.app.Activity.onCreate(Activity.java:986) at androidx.core.app.e.onCreate(Unknown Source:0) at androidx.activity.ComponentActivity.onCreate(Unknown Source:0) at androidx.fragment.app.d.onCreate(Unknown Source:99) at androidx.appcompat.app.e.onCreate(Unknown Source:10) at c.c.a.k.a.onCreate(Unknown Source:0) at com.xyz.firsttime.Welcome.onCreate(Unknown Source:2) at android.app.Activity.performCreate(Activity.java:6975) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2773) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1596) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6565) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
There is a bug in Android 8 (SDK 26), that prevents activities from locking screen duration if <item name="android:windowIsTranslucent">true</item>
is set in the activity's style.
The material-intro library uses that flag for the fade-out effect while swiping away the last slide.
As far as I know, the only solution would be to either disable window translucency for API 26 devices, or to not lock orientation while the intro is visible.
@chimbori would you like to investigate this issue?
Easiest is disabling the orientation and it worked. How can I disable window translucency only for API 26 devices?
would you like to investigate this issue? Sure
When the application call's the Welcome class that extends IntroActivity on version 1.6
I've got an error
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xyz/com/xyz.firsttime.Welcome}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
The Application Manifest is
and Welcome Activity in Manifest
I've got this error only on Android one device with version Android 8.
How to resolve this issue?