Vikas Sharma
Vikas Sharma

Reputation: 35

How to make single copy of an activity over entire application

Here i have opened activity in following order A->B->C->D now i just want to re-launch activity B so that order becomes: A->C->D->B

can anyone please tell me that how can i achieve this state in android.

Thanks in advance.

Upvotes: 0

Views: 81

Answers (2)

Manish Gupta
Manish Gupta

Reputation: 139

Do this in your manifest file for activity B:

<activity 
   android:name=".B"
   android:launchMode="singleTask"/>

Upvotes: 1

nikeru8
nikeru8

Reputation: 202

now you have A B C D in your app try the following below:

Intent intent = new Intent(xxx.this, B.class);    
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);      
startActivity(intent);

also check file in here

Upvotes: 0

Related Questions