You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
When starting PIP Activity normally, PIP activity will launch on a new Task which taskAffinity is same as application packagename.
So we have two Task with same taskAffinity.
Then if you start an activity with singleTask mode, it will launch on Task just create for PIP activity.
I solved this problem by setting a special taskAffinity for PIP activity.
Setting Special taskAffinity can launch PIP activity on a independent Task.
Then activity with singleTask mode will not be launched on Task that PIP Activity was in.
When starting PIP Activity normally, PIP activity will launch on a new Task which taskAffinity is same as application packagename. So we have two Task with same taskAffinity. Then if you start an activity with singleTask mode, it will launch on Task just create for PIP activity.
I solved this problem by setting a special taskAffinity for PIP activity. Setting Special taskAffinity can launch PIP activity on a independent Task. Then activity with singleTask mode will not be launched on Task that PIP Activity was in.
However, this will produce multiple windows on the task list, which cannot be satisfied for applications such as video conferencing
In order to solve this problem, i add task affinity to the support pip activity in the manifest.xml. This causes another problem,
when press home key ,the activity is background ,and user click icon from the home desk, the app start and go to the main task(the app default package name task), not the support pip activity. I foreach the app tasks, find the task containing the support pip activity, and call " task.moveToFront();" to bringfront the activity , the activity go in pip mode normally. I go to the activity normal mod and finish the activity. After that , I click the button,and go to the support pip activity again, this time ,the system log shows the activity go to pip mode ,but the min window not shown. million seconds later, the system log shows the app is in background.
The above can be reproduced in android14 system.
Finally, i change the called code from "task.moveToFront();" to " activityManager.moveTaskToFront()", the bad result above is gone. I don't know why, just guess that , "task.moveToFront();"maybe cause PIP mode out of time sequence.
Activity
iostyle commentedon Sep 21, 2022
When PIP activity and other singleTask activity in the same task.
BambooXiu commentedon Mar 30, 2023
yes, I have met this error too, that is very disappointed ! So, DO NOT USE PIP !!!
pinehallnick commentedon May 9, 2023
Did pip solve this problem? I encountered the same problem
BambooXiu commentedon May 14, 2023
Unfortunately not yet
mohsenoid commentedon Aug 24, 2023
I had the same issue and this answer looks promising,
https://stackoverflow.com/a/54086060/2359762
Have you tried
taskAffinity
instead ofsingleTask
?opLW commentedon Sep 11, 2023
When starting PIP Activity normally, PIP activity will launch on a new
Task
whichtaskAffinity
is same as application packagename.So we have two
Task
with sametaskAffinity
.Then if you start an activity with
singleTask
mode, it will launch onTask
just create for PIP activity.I solved this problem by setting a special
taskAffinity
for PIP activity.Setting Special taskAffinity can launch PIP activity on a independent
Task
.Then activity with
singleTask
mode will not be launched onTask
that PIP Activity was in.pinehallnick commentedon Oct 22, 2023
However, this will produce multiple windows on the task list, which cannot be satisfied for applications such as video conferencing
focuseyes360 commentedon May 17, 2024
In order to solve this problem, i add task affinity to the support pip activity in the manifest.xml. This causes another problem,
when press home key ,the activity is background ,and user click icon from the home desk, the app start and go to the main task(the app default package name task), not the support pip activity. I foreach the app tasks, find the task containing the support pip activity, and call " task.moveToFront();" to bringfront the activity , the activity go in pip mode normally. I go to the activity normal mod and finish the activity. After that , I click the button,and go to the support pip activity again, this time ,the system log shows the activity go to pip mode ,but the min window not shown. million seconds later, the system log shows the app is in background.
The above can be reproduced in android14 system.
Finally, i change the called code from "task.moveToFront();" to " activityManager.moveTaskToFront()", the bad result above is gone. I don't know why, just guess that , "task.moveToFront();"maybe cause PIP mode out of time sequence.
OnClickListener2048 commentedon Nov 14, 2024
up