Hi i want to know how to close an application in Android. Actually i am having idea by using the finish() method we can close present activity.. But what i want is, the following code defines remaining...
Main.java
Handler handle=new Handler();
handle.postDelayed(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
startActivity(new Intent(ZzzzzProjActivity.this,Second.class));
}
}, 3000);
Second.java
/*** same above code***/
Third.java
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if(keyCode == KeyEvent.KEYCODE_BACK)
{
Toast.makeText(getApplicationContext(), "backbutton", 30).show();
finish();
}
return super.onKeyDown(keyCode, event);
}
As per the following code after coming to Third.java, when i click back button it is navigating back to Second.java page. But what i want is my applications needs to close totally. Can anyone help me with this....