how to delete an activity in android studio code example
Example: how to destroy activity in android
Intent intent = new Intent(this, NextActivity.class);
startActivity(intent);
finish();
Intent intent = new Intent(this, NextActivity.class);
startActivity(intent);
finish();