Saltar al contenido

Crear Activity y Lanzar un Botón en Android

Hola en este tutorial vamos a crear una actividad y luego creamos el botón.
Primero creamos la actividad:
Segundo le añadimos el botón:

Dentro de la clase.java:

Button volver =(Button) findViewById(R.id.buttonVolver);

volver.setOnClickListener(new View.OnClickListener() {

    @Override

   
public void onClick(View view) {

        Intent Main =new Intent(registro.this, MainActivity.class);

        startActivity(Main);

    }

});

Esto ha sido todo por el tutorial de hoy espero que hayan aprendido algo y hasta la próxima.

Gracias por visitar mi blog de informática, mi nombre es Tomás y soy formador y desarrollador web. Si quiere usted dejarme alguna sugerencia, ayuda o quiere un servicio de formación estoy escuchando ofertas en tomas.gonzalez@infogonzalez.com, en Facebook a https://www.facebook.com/Infogonzalez estoy deseando escucharle. Su duda o sugerencia NO molesta.

Tomas Gonzalez
error: Content is protected !!
Este sitio web utiliza cookies, si necesitas más información puedes visitar nuestra política de privacidad    Ver
Privacidad
Creative Commons License
Except where otherwise noted, the content on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
A %d blogueros les gusta esto: