I'm working on an application and I need to make it possible to launch an activity in a separate history and stack as you can see in the photo that the application of the telephone starts the activity to make calls that works independently and even this can be observed when I want See recent apps.
Asked
Active
Viewed 514 times
1
-
What have you tried? Show the intent that you are using to start your activity. – Dale Wilson Feb 23 '17 at 19:15
-
For the moment I only use the conventional form: "Intent in = new Intent (getActivity (), ActivityB.class); In.addFlags (Intent.FLAG_ACTIVITY_CLEAR_TASK); In.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); StartActivity (in); ". But I can not accomplish what I explain in my question with this. – Rafael Bartra Zevallos Feb 23 '17 at 19:22
3 Answers
0
In the Manifest file for your application
In the <activity> element
Add an attribute: android:process=".ProcessName"
This will cause that particular activity to be launched in a new process.
For more details, search for "android:process" on this page

Dale Wilson
- 9,166
- 3
- 34
- 52
0
For creating a separate and independent history and stack, you need to set these flags :
Intent intent = new Intent(this,ActivityA.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
startActivity(intent);
In this manner, you have two sets of activities, with their own separate listing in the recent apps list.

Ali Maddi
- 309
- 3
- 8