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 without entering the onCreate.
This is the code for the third activity:
startActivity(new Intent(TerceraActiviry.this, Main.class));
If your Activity
is still running, this code will bring it to the front without entering onCreate
Intent openMainActivity = new Intent(TerceraActiviry.this, Main.class);
openMainActivity.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivityIfNeeded(openMainActivity, 0);