I have 4 activity let suppose activity "A","B","C" and "D" when I move from C>D>A and when I press Device back button from Activity "A",then "C" became visible to me instead of exist from app.How can I acheive this.
In Activity A you can finish all activities in onResume for that you need to store all activity's this in staic variable
Activity B
public static B b;
oncreate(){
//...
b=this;
}
Do the same for C and D and in A
onResume(){
clearAllTasks();
}
public void clearAllTasks(){
if(B.b!=null){
B.b.finish();
}
if(C.c!=null){
C.c.finish();
}
if(D.d!=null){
D.d.finish();
}
}
in manifest
<application>
<activity android:name="A"
android:noHistory="true">
</activity>
//...
</application>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments