Answer the question
In order to leave comments, you need to log in
Which function closes an application in Android?
I am writing a program for Android. There are 2 Activities in the program. In the first activity there is a button, when clicked, the user gets to the second activity. It is necessary to make it so that, being in the second activity and when you click on the back button, the application closes, and does not return to the first activity, as by default.
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
// super.onBackPressed();
// Что тут написать для закрытия приложения?
}
Answer the question
In order to leave comments, you need to log in
There is no such feature. Moreover, the user does not need it, because. it has a home button. It's strange that you need it.
You can call finish on all living Activity instances.
Here are a couple more solutions www.androidsnippets.com/kill-you-application
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question