i want to create an activity, in which, i would like to have a listview, there can be about 20-30 items in a list view,on tapping any particular value in listview, it should move to another activity, with the data of list view.
Just wanna pass data from listview to another activity.
Suggestion plz
Regards
Implement
ListView‘s OnItemClickListener, once you handle this event, try to get the location of the row that was clicked.Once you get it, access that particular row position in the source array (or whatever else you’re having). This way, you’ll have the data that you want to pass to another activity.
Now use this code:
and when the
anotherActivityIntentstarts theAnotherActivityclass, use following code to access the value that you had passed:Now you have your data in
myValvariable. you can use any other data type, whichever you like.