In my application,it requires to start the application from the starting activity or the first activity;as the application is authenticated by a login section..
So,whenever the application gets exit;say,via pressing BACK or HOME button,i need to start the application from the login itself…Is there any method to do the same?
I tried a simple technique by overriding the KEYEVENT,and implementing the finish() method inside.It works for the the BACK button;but its not working for the HOME button…
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_HOME) {
finish();
}
if (keyCode == KeyEvent.KEYCODE_BACK) {
finish();
}
return false;
}
Ya got the answer…
I just included the following attribute for the first activity to be displayed all the time,as i said in my question…
also include this attribute for the other activities…
Just try……