简体   繁体   中英

What happens if I don't use launchMode “singleTask” in android?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM