4

I have a video call activity and I am using pip mode for it. In pip mode, I try to open related chat activity using remote action. But when a startActivity is called from pip activity, the new activity is being opened in the pip screen too. But I do want to open the chat in our app, not in pip screen. Is it possible to start our own activity outside of the pip screen?

buttib
  • 113
  • 3
  • 12
  • have you fixed this issue? as I am getting the same issue like when I start a second activity from the PIP activity.PIP view of the previous activity does not come up – Mohit Dholakia Dec 24 '20 at 07:56
  • Yes I fixed it with the answer below. You should add something like that to your pip activity in the manifest: `android:taskAffinity=".YourActivityNameOrAnyString"` – buttib Dec 25 '20 at 19:01
  • 1
    Ok, but my issue is a bit different as when I start a new activity from PIP Activity the PIP view doesn't come up any help in this case? – Mohit Dholakia Dec 28 '20 at 05:13

2 Answers2

5

Adding taskAffinity solves my problem. You can see detail here: https://developer.android.com/guide/topics/manifest/activity-element#aff

Cüneyt
  • 2,565
  • 25
  • 31
0

Adding launchMode of VideoActivity as singleInstance in manifest file solves the problem. ex.

android:launchMode="singleInstance".

It will allow to enter PIP activity in separate task so it will resolve back press and next screen navigation issues automatically.

m4n0
  • 29,823
  • 27
  • 76
  • 89