This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onKeyDown(int keyCode, KeyEvent event) { | |
if (keyCode == KeyEvent.KEYCODE_BACK) { | |
// Bloquiar la tecla volver para no cerrar el app | |
return false; | |
} | |
return super.onKeyDown(keyCode, event); | |
} |
Otra alternativa con el botón Atras o "Back" también es utilizar "onBackPressed()" pero esta disponible de AndroId 2.0 en adelante:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onBackPressed() { | |
// hacer algo con un metodo | |
return; | |
} |
Mas información sobre lo anterior ACÁ
No hay comentarios:
Publicar un comentario