I have an app with 3 activities.
I have the main activity. This calls the second activity, which then calls the third activity. I want return to the main activity wi
The launch mode flag you want is clearTop. This will go back to the previous instance of the main activity and clear the second and third activity off the activity stack. For example, to do this from the code:
Intent intent = new Intent(TerceraActiviry.this, Main.class));
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);