Home Menu

Menu



Avisos

Programación y Desarrollo para Android Subforo exclusivo para temas de programación de software para PDAs y desarrollo de aplicaciones, interfaces, etc bajo Android


 
Herramientas
  #1  
Viejo 12/11/15, 22:01:03
Avatar de esi92
esi92 esi92 no está en línea
Usuario poco activo
Mensajes: 20
 
Fecha de registro: nov 2015
Mensajes: 20
Modelo de smartphone: Energy Phone Max
Tu operador: Vodafone
Mencionado: 3 comentarios
Tagged: 0 hilos
Bundle

Hola compañeros! A ver si me podeis ayudar con esta pequeña duda. Quiero que al pulsar el botón "botonAceptar" de la Activity2 se envie la cadena "Aceptar" al TextView "resultado" de igual forma con el botón "botonRechazar". No me funciona y se me han agotado las ideas... Este es mi codigo:
Activity1 (a)
Bundle bundle = getIntent().getExtras();
resultado.setText(bundle.getString("ACEPTAR"));
resultado.setText(bundle.getString("RECHAZAR"))
Activity2 (b)
botonAceptar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("ACEPTAR", "Aceptar");
Intent intent = new Intent(b.this, a.class);
intent.putExtras(bundle);
startActivity(intent);
}
});
botonRechazar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("RECHAZAR", "Rechazar");
Intent intent = new Intent(b.this, a.class);
intent.putExtras(bundle);
startActivity(intent);
}
});

Última edición por esi92 Día 12/11/15 a las 22:03:27
Responder Con Cita


Respuesta

Estás aquí
Regresar   HTCMania > Todo sobre Android > Programación y Desarrollo para Android


Reglas de Mensajes
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Las caritas están On
Código [IMG] está On
Código HTML está Off

Saltar a Foro



Hora actual: 00:32:12 (GMT +1)

Cookies
Powered by vBulletin™
Copyright © vBulletin Solutions, Inc. All rights reserved.
 
HTCMania: líderes desde el 2007