![Ampliar imágen de perfil de tesi Imágen de perfil de tesi](/usr/184000/184255/profileImage.jpg?1447610349)
Bundle
Publicado por tesi (8 intervenciones) el 13/11/2015 10:25:47
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)
Activity2 (b)
Activity1 (a)
1
2
3
Bundle bundle = getIntent().getExtras();
resultado.setText(bundle.getString("ACEPTAR"));
resultado.setText(bundle.getString("RECHAZAR"))
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
}
});
Valora esta pregunta
![Me gusta: Está pregunta es útil y esta clara Me gusta: Está pregunta es útil y esta clara](/img/img.png?11.51)
![NO me gusta: Está pregunta no esta clara o no es útil No me gusta: Está pregunta no esta clara o no es útil](/img/img.png?11.51)
0