Activity launcher
I have three activities like Activity A - Activity B - Activity C . Activity launch through intent. When Activity C is launched and I click back button to get activity A with out handle back pressed. How can I get this?
Activity launcher
I have three activities like Activity A - Activity B - Activity C . Activity launch through intent. When Activity C is launched and I click back button to get activity A with out handle back pressed. How can I get this?
On
If you are in Activity C and you want to go back to Activity A without going to Activity B you should use flags.
Intent startActivityA = new Intent(ActivityC.this,ActivityA.class);
startActivityA.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startActivityA);
When you are launching Activity C from B then after
startActivity()method call finish() in Activity-B. It will remove Activity-B from activity-stack.