I have two different activities. The first launches the second one. In the second activity, I call System.exit(0) in order to force the application to close, bu
The easiest way for achieving this is given below (without affecting Android's native memory management. There is no process killing involved).
Launch an activity using this Intent:
Intent intent = new Intent(this, FinActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
In the target activity FinActivity.class, call finish() in onCreate.
Steps Explained:
You create an intent that erases all other activities (FLAG_ACTIVITY_CLEAR_TOP) and delete the current activity.
The activity destroys itself. An alternative is that you can make an splash screen in finActivity. This is optional.