Questions tagged [taskaffinity]
31 questions
110
votes
3 answers
Android Task Affinity Explanation
What exactly is the attribute taskAffinity used for? I have gone through the documentation but I couldn't understand much.
Can anyone explain task affinity in laymans terms?
![](../../users/profiles/2522546.webp)
Traxex1909
- 2,450
- 4
- 17
- 23
14
votes
1 answer
setting cpu affinity of a process from the start on linux
I want to set the cpu affinity of a process on linux when it is starting.
There are methods like sched_setaffinity and taskset, but they need the processid of the process. They may cause potential migration like a process was started on a core but…
![](../../users/profiles/2136303.webp)
ajay saini
- 185
- 1
- 1
- 8
10
votes
1 answer
android 4.4.X: taskAffinity & launchmode vs. Activity lifecycle
I developed a simple application, which demostrates some strange behaviour on Android 4.4.X devices I noticed.
Lets say I want to have 2 "main" activities, where the first says "Hello" (by starting 'HelloActivity') every second time it is resumed…
![](../../users/profiles/1041723.webp)
Berťák
- 6,819
- 2
- 26
- 37
10
votes
2 answers
How to remove singleTask activity with taskAffinity from recent tasks when it is finished?
Let assume we have two activities.
A - main activity, that is "home launcher enabled" (proper intent filters etc.)
B - task root activity with singleTask specification (there can be only one instance of this activity) and with custom taskAffinity…
![](../../users/profiles/294736.webp)
Michael P
- 608
- 7
- 23
7
votes
1 answer
How does android:taskaffinity work?
How does android:taskaffinity attribute work?
As per my understanding, pressing the Home key will move the activity to back stack, but it will not be destroyed. I am confused.
![](../../users/profiles/1933455.webp)
user1933455
- 71
- 1
- 3
2
votes
1 answer
Not Working corss-application activities with taskAffinity in Android 11
I have two application, App A and App B, now I want to start an activity in App B from App A, the launchmode of this Activity is “singleTask”.
The order:
Activity X (App A) ———> Activity Y (App B) ———> Activity Z (App B, launchMode=“singleTask”)
As…
![](../../users/profiles/11543658.webp)
YikFung
- 21
- 1
2
votes
1 answer
task affinity for singleInstance activity?
I want to know what is the default task affinity for singleInstance activity?
Since each singleInstance Activity opens up as root activity in a new task.
and there is no need to declare android:taskAffinity.
See I have read the developer guides and…
![](../../users/profiles/4460535.webp)
Yogesh Seralia
- 332
- 5
- 21
2
votes
3 answers
Android launch an activity from a broadcast receiver
I know it may not be best practice but this is what i want to do.
When my broadcast receiver is called - start a new activity which has is not fullscreen and has a transparent background - which opens on top of your current activity / desktop…
![](../../users/profiles/265683.webp)
RenegadeAndy
- 4,849
- 14
- 58
- 115
2
votes
1 answer
How to change task affinity in Android?
There is an activity (A) in my application that can be called from other apps (B)
if A is called from B, in recent task there are an instance of B and an instance of A. i want that A be showen as part of B Task.
I've found that by adding same…
user3473590
2
votes
2 answers
Commutative property of the commands
I need to ask this question just to double check the answer.
Does the order of the commands matter? For example:
Is this command
taskset 0x2 time echo "foo"
equal than
time taskset 0x2 echo "foo"
?
I need to know if all the commands followed by…
![](../../users/profiles/1051765.webp)
Carlos Vega
- 1,232
- 2
- 12
- 32
2
votes
1 answer
starting an Activity from Broadcast Receiver brings up Default Activity
My app contains two activity, one widget and a broadcast receiver.
First activity is default one which is called by home launcher. Second activity is a reminder dialog activity which plays a MP3 and has a dismiss button. It will appear on home…
![](../../users/profiles/893432.webp)
Ali
- 18,627
- 13
- 75
- 90
1
vote
1 answer
Issue with taskAffinity and excludeFromRecents on Android 10
I have an application which is sometimes displaying notifications to users.
When pressing a notification, a "Dispatch" Activity is triggered which calls startActivities with some intents leading to proper activity depending on the notification…
![](../../users/profiles/2358556.webp)
Loïc
- 342
- 2
- 9
1
vote
1 answer
Check value of PF_NO_SETAFFINITY
Is it possible to tell whether a process/thread has the PF_NO_SETAFFINITY flag set? I'm running taskset on a series of process ids and some are throwing errors of the following form:
taskset: failed to set pid 30's affinity: Invalid argument
I…
![](../../users/profiles/7206952.webp)
Will
- 902
- 1
- 9
- 20
1
vote
0 answers
How to make FLAG_ACTIVITY_NEW_TASK ignore taskAffinity?
I have a problem with two of the buttons in a launcher app I'm developing. The first button should launch TotalCommander's built-in text editor to display a certain text file. The second button should launch TotalCommander. So I started with the…
![](../../users/profiles/1293492.webp)
Tamás Bolvári
- 2,530
- 3
- 28
- 49
1
vote
1 answer
When taskAffinity activity is calling finish() but it is not dismiss recent apps
I have taskAffinity activity which is BActivity and AActivity is a normal activity.
AActivity is calling BActivity by using below startActivity function. When BActivity's jobs have done, BActivity called finish(); function but BActivity doesn't…
![](../../users/profiles/5802997.webp)
begiNNer
- 128
- 11