Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/05/2014, 17:18
toluca1974
 
Fecha de Ingreso: mayo-2014
Mensajes: 1
Antigüedad: 10 años
Puntos: 0
error al obtener un dato de getIntent() android

public class SecondActivity extends ActionBarActivity {

public String boton;

. . . . . .

public void menuLista(View v){

//Creo y asigno la información a enviar.

Intent men = new Intent(this, menu.class);

//act.putExtra(ACT_INFO, info);

men.putExtra(boton, 1);

startActivity(men); }
.. . . . . .


Y luego quiero obtenerlo asi en una clase:


public class menu extends ActionBarActivity {

private ListView lista;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.listado);

String tipo =getIntent().getStringExtra("boton");

. . . . . .

if (tipo =="agr"){