0

I am implementing picture in picture mode. Documentation says you can use android:launchMode="singleTask" and override onNewIntent(). If I does so, it calls onConfigurationChanged() (if activity is in picture in picture mode). So, I don't want this.

What happens if I don't use singleTask launchMode? Does it will cause some problems or bugs when that particular activity is launched for the second time?

Chaitanya Karmarkar
  • 1,425
  • 2
  • 7
  • 18

1 Answers1

1

For PIP, using singleTask is ideal as it will create a whole different stack for handling PIP features. If the user is in pip mode and if the user clicks on the app icon, no new task will be created, the same task will be reused and intent will be passed to onNewIntent(Intent intent) method. By this way, we can implement pip in single activity app as we don't have to maintain backstack in a single activity.

tronku
  • 490
  • 4
  • 12
  • Yes this is absolutely true. But my application is browser app. So I want to open new tab in onNewIntent(). So if app is in pip mode, then it calls onconfigurationchanged(). That causes some problems which will not happen if I don't use singleTask as a launch mode. Now is that perfectly fine? Or will it cause some other problems? And what if user opens video in pip mode in that new tab when already there is pip mode for previous activity instance is running? – Chaitanya Karmarkar Dec 16 '20 at 05:30