Antonio Antonio - 7 months ago 48
Android Question

Transfer a string from list view on one activity to another in android

How is it possible to transfer a string from a listView on click and use the string saved in a variable in a different activity?


You can do this by writing code for calling next activity in listview's item click event

Intent intent= new Intent(getBaseContext(),AnotherActivity.class);
            intent.putExtra("ANY_KEY", "YOUR STRING VALUE");

Then in other activity's on create method get value of your string by

String str=getIntent().getStringExtra("ANY_KEY");