1

i am trying to do a simple information transition between activities. The problem is, in the received activity I am getting stuck in get.Extras() == null

here is the receive activity code:

helloName = (TextView) findViewById(surfaceName);
Bundle extra = getIntent().getExtras();
String nome = extra.getString("keyName");
System.out.println(nome) ;   #PRINTING =null
helloName.setText("Olá "+nome); 

Here is my passing information Activity:

Editable nome = name.getText();
System.out.println(nome);
Intent intent = new Intent(HelloActivity.this, MainActivity.class);
intent.putExtra("keyName",nome);
System.out.println(intent.getExtras());
startActivity(intent);
Juan
  • 4,910
  • 3
  • 37
  • 46
Aury0n
  • 217
  • 3
  • 14

1 Answers1

0

try

   Editable nome = name.getText();
   System.out.println(nome);
   Intent intent = new Intent(HelloActivity.this, MainActivity.class);
   intent.putExtra("keyName",nome.toString());
   System.out.println(intent.getExtras());
   startActivity(intent);
Matthew Shearer
  • 2,715
  • 3
  • 23
  • 32