shaun-chiang / rn-android-pip

React Native Android Picture-in-Picture Library.
MIT License
17 stars 24 forks source link

Fatal Exception: java.lang.IllegalStateException Activity must be resumed to enter picture-in-picture #3

Closed rmamtaventures closed 2 years ago

rmamtaventures commented 4 years ago

App Crash information:-

com.reactlibrary.RNAndroidPipModule.enterPictureInPictureMode (RNAndroidPipModule.java:4) java.lang.reflect.Method.invoke (Method.java) com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:149) com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:21) com.facebook.react.bridge.queue.NativeRunnable.run (NativeRunnable.java)

Yatanvesh commented 4 years ago

https://github.com/shaun-chiang/rn-android-pip/pull/4

I know this directly does not solve your issue, but I upgraded a couple of things in this package which might fix your crash

rogerkerse commented 4 years ago

I think it happens when you say "go to pip" after app is already in the background. When calling it before worked for me

AswathiRevathi commented 3 years ago

@rogerkerse if app goes background how can we call this enterpictureinpicture mode?I need to show the pipmode when we click on home button.How this can be done?

Yatanvesh commented 3 years ago

I did this by directly overriding the java method onPause and handling pip logic there. You may try several react native libraries that fire when activity moves to background.