Skip to content Skip to sidebar Skip to footer

How To Get String From Intent?

I wrote some code to get text from the EditView, put it in the Intent Extras and set it in a TextView on other Activity. Here is my code from the sending Activity Intent intent =

Solution 1:

use

intent.putExtra("CaptionOne", txt_caption1.getText().toString);

instead of

intent.putExtra("CaptionOne", String.valueOf(txt_caption1.getText()));

and also datatype of caption should be String

Solution 2:

use

Intenti= getIntent();
StringData= i.getStringExtra("Data");

Post a Comment for "How To Get String From Intent?"