Closed NerdFaisal404 closed 5 years ago
+1
anyone can fix?
This probably happens because you have android:screenOrientation="portrait"
or android:screenOrientation="landscape"
declared for your Activity
in your manifest.
Remove it and use the following in your Activity
class instead:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
or
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
@HBiSoft I just tested your idea but din't work. The app is still crashing even after removing those settings from the manifest file.
@Hasemedin have a look at this - https://stackoverflow.com/a/52964692/5550161
@HBiSoft, thanks for the link. The problem is the crash Happens in the Lib side. Therefore, the change in my activity doesn't prevent the fix (because crash is not because of my activity).
I found that something has changed in the new version that fixes the issue. I was using the lib version 2.4.0. After upgrading to the latest version 2.4.4
then my app didn't crash.
(net.alhazmy13.mediapicker.Video.VideoActivity}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2830) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2909) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1606) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6592) 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:769) Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation at android.app.Activity.onCreate(Activity.java:991) at android.support.v4.app.SupportActivity.onCreate(SupportActivity.java:66) at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:321) at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:84) at net.alhazmy13.mediapicker.Video.VideoActivity.onCreate(VideoActivity.java:54) at android.app.Activity.performCreate(Activity.java:6984)