Do you mean the re-start of action A? While the most common approach is to re-launch a new Intent with the same class, I think it uses too much memory. I would prefer to create an init method that should be called from onCreate And when you want to restart your activity. Example:
public void onCreate(Bundle si){
If you wrote: โFinish this, then start Activity Aโ instead of โActivity Bโ, and then immediately after startActivity () - into the A-call โfinishโ action. Example:
// This is inside Activity A Intent i = new Intent(this, ActivityB.class); startActivity(); finish(); // This will be called right after 'Activity B' finishes
source share