Android集成友盟QQ分享闪退,IllegalStateException: Only fullscreen opaque activities can request orientation

问题

集成友盟,分享到QQ,出现闪退。

手机:华为P10,操作系统:安卓 8.0

2018-08-23 22:30:24.572 1264-1264/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.umeng.soexample, PID: 1264
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.umeng.soexample/com.tencent.connect.common.AssistActivity}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3194)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302)
        at android.app.ActivityThread.-wrap12(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
        at android.os.Handler.dispatchMessage(Handler.java:108)
        at android.os.Looper.loop(Looper.java:166)
        at android.app.ActivityThread.main(ActivityThread.java:7425)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
     Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
        at android.app.Activity.onCreate(Activity.java:1081)
        at com.tencent.connect.common.AssistActivity.onCreate(AssistActivity.java:46)
        at android.app.Activity.performCreate(Activity.java:7372)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3147)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302) 
        at android.app.ActivityThread.-wrap12(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891) 
        at android.os.Handler.dispatchMessage(Handler.java:108) 
        at android.os.Looper.loop(Looper.java:166) 
        at android.app.ActivityThread.main(ActivityThread.java:7425) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) 

解决办法:

     删除AssistActivity定义中的android:screenOrientation="portrait"

完整分享样例(含QQ和微信分享):

https://github.com/cxyzy1/shareDemo

 

安卓开发技术分享:https://blog.csdn.net/yinxing2008/article/details/84555061

你可能感兴趣的:(安卓)