posted 11 years ago
Dear folks,
We all know that when we call the finish() method of the activity on click of a button, say "Exit", the application exits. True. This is true for my app which I am creating. All the activity's current state are destroyed.
I have written the following code:
btnExit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
}
But the problem is that, if the user clicks on the home button directly without clicking on the "Exit" button, the application state remains as it is. The point from where I exit the application on the press of the home button of the android phone, remains as it is as if it is asking me to continue from where I have left. How to destroy the application completely? Please do not ask me to search this forum. I've already done that.