Skip to content Skip to sidebar Skip to footer

Passing Data To Listview From Other Activity Using Intent

I'm having 2 activities in my project where 1st activity has a list view and a button and 2nd activity has EditText and other info and a Button. i want to to pass data from 2nd act

Solution 1:

you pass your data with following code:

goback.putExtra("Details",detls);

and you got that with following code:

Stringdet_rec= data.getStringExtra("details");

as you see Details is not same as details, change one of them ,

as you use onActivityResult you must check requestCode and resultCode, for using that field you can read This

i think you need read creating list tutorial, you can start with This, because i this implementation not worked at all:

ListAdapter adapter = newArrayAdapter<String>(this,android.R.layout.simple_list_item_1, Integer.parseInt(det_rec));

you must pass one ArrayList and in your code ArrayList<String> to your adapter instead of Integer.parseInt(det_rec)

Post a Comment for "Passing Data To Listview From Other Activity Using Intent"