Skip to content Skip to sidebar Skip to footer

Pass Text Between Activities

Possible Duplicate: Passing data between activities in Android How can I edit text in my Activity, then pass this text by an intent to a new Activity?

Solution 1:

You can pass extra data via the intent using intent.putExtra("key", text_field.getText().toString()) on the intent before you send it (in the first activity) and getIntent().getExtras().getString("key") in the second activity.

This is assuming text_field is your EditText you want to pass the value from. You can change "key" to whatever you want, too.

Post a Comment for "Pass Text Between Activities"