I have a task stack of A > B > C. I am currently on C, and then I press the home button. I get a notification with the intent to take me to Activity A. I press the notificat
My solution code:
public class MyApplication extends Application{
private static int activityCounter;
public Activity A,B,C;
public void incrementActivityCounter()
{
activityCounter++;
}
public void decrementActivityCounter()
{
activityCounter--;
if (activityCounter == 0)
{
A.finish();
B.finish();
C.finish();
}
}
}
public class A extends Activity{
@Override
protected void onStart()
{
super.onStart();
application.incrementActivityCounter();
}
@Override
protected void onStop()
{
application.decrementActivityCounter();
super.onStop();
}
}