miércoles, 24 de octubre de 2012

Closing Application with Exit button



Closing Application with Exit button. How to?

Sometimes we need to add a button the ability to close the current Activity (View). For doing that is the following code. Put that into an "onCreate" event and that is all...



this.close_Button = (Button)this.findViewById(R.id.close);
   this.close_Button.setOnClickListener(new OnClickListener() {
     @Override
     public void onClick(View v) {
        finish();
     }
  });

No hay comentarios:

Publicar un comentario