Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/01/2013, 13:01
Alemanarg
 
Fecha de Ingreso: julio-2008
Ubicación: Buenos Aires, Mar del plata
Mensajes: 250
Antigüedad: 15 años, 9 meses
Puntos: 2
Respuesta: Java andriod cerrar aplicación "finish()" not work

La implementación de un botón para finalizar la app debe ser tan simple como esto:

Código JAVA:
Ver original
  1. Button boton1 = (Button) findViewById(R.id.Button01);
  2.        
  3.         //Implementación del botón "Salir"
  4.           boton1.setOnClickListener(new OnClickListener() {
  5.                  
  6.             public void onClick(View v) {
  7.                     setResult(RESULT_OK);
  8.                     finish();
  9.             }
  10.         });