I created an app where I put two principal activities. This is the code I added in the Manifest:
<activity android:name=".MainActivity">
</activity>
<activity android:name=".Menu">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
To quit, i connected two methods to two buttons, one in the first activity and one in the second.
public void Quit1(View v){
finish();
System.exit(0);
}
public void Quit2(View v){
finish();
System.exit(0);
}
If i click the first button(connected with Quit1), the app closes(that's what I wanted) but when i press the second one(connected with Quit2), I return at the first activity. How can I quit also in the second activity?