We are developing an application in which we want to exit a login screen of press event of a device (hardware) back button. So can you please help me on that and tell me how I can exit login screen on back button press event of device? If we want to exit App(application) then what should we do to exit App(application) on back press event of device. Thanks in advance
@Override
protected void beforeSearchForm(Form f) {
Command cancel = new Command(" "){
@Override
public void actionPerformed(ActionEvent evt) {
Log.p("Cancel/back pressed from beforeSearchForm() (yes its Keypad.!!)");
if(Dialog.show("Logout ?", "Do you want to log out ?", Dialog.TYPE_INFO, null, "Yes", "No")){
//its Yes
}else{
//its No
}
}
};
f.setBackCommand(cancel);
}