Reputation: 8335
I managed to create a secondary Activity, but now I wonder how I can close it again.
public void button_onClick(View v){
finish();
}
works when I'm dealing with just one Activity at a time, but how do I let the secondary Activity close the entire application?
Upvotes: 1
Views: 444
Reputation: 367
It's work for me. In the FIRST Activity:
private boolean flag = false;
@Override
protected void onResume() {
if(!flag)
flag = true;
else
finish();
super.onResume();
}
Upvotes: 0
Reputation: 1006789
You don't "close the entire application" in Android, any more than you "close the entire application" in a Web app. See this answer for more on this topic.
Upvotes: 2