windowIsTranslucent 8。0 report error
xiang473535976 opened this issue · comments
Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
at android.app.Activity.onCreate(Activity.java:987)
at android.support.v4.app.BaseFragmentActivityGingerbread.onCreate(BaseFragmentActivityGingerbread.java:54)
at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:319)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:85)
at com.trello.rxlifecycle2.components.support.RxAppCompatActivity.onCreate(RxAppCompatActivity.java:59)
at aichen.overseas.shop.act.BaseActivity.onCreate(BaseActivity.kt:74)
at android.app.Activity.performCreate(Activity.java:6977)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at cn.jiguang.a.a.d.a.a.d.callActivityOnCreate(Unknown Source:24)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2786)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2914)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1609)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6567)
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)
Getting same error in Oreo :(
我也碰到这个错误,去掉“android:windowIsTranslucent 这个属性就不报错,但是侧滑会黑屏,请问有解决办法么?
You can remove android:screenOrientation="portrait" in your AndroidManifest.xml.
Set your MainActivity not supports swipe back.The code is setEnableGesture(false),And set android:windowIsTranslucent=false.
强制竖屏与android:windowIsTranslucent = true ,有办法解决吗 android 8.0
直接在AppTheme中设置
item name="android:windowIsTranslucent">true</item
item name="android:screenOrientation">portrait</item