Display PIP view after app goes in background
I want to start PIP mode when the application moves to the background state. In some devices AppState's change listener reflects before the application fully moves to the background in those cases I'm able to start PIP mode but in Android 13 devices, the "change" listener reflects when the application completely moves to the background at that time PIP mode view is not getting visible.
I figured out the issue, If I update any state or dispatch action above PipHandler.enterPipMode the PiP view will not be visible on swipe mode.
Out of the topic: If we use any library to display toast messages in the app, toast messages appear before PipHandler.enterPipMode will display in PIP View, to avoid this issue use ToastAndroid.