lundi 22 décembre 2014

How To Set On Click Listener To ListView Items Loaded From Web Server

I Was Trying To Implement Web Service In My Application So That I Can Add New Items Into A ListView Without Having To Update My Application Each Time..


I found a lot of tutorials on how to populate a listview from web server/json


But I wasn't able to figure out how to apply onclicklistener to the items loaded from web server/ json


This is the code that I am using without a web service :



case 6:
desc = "blah blah blah";
owner = "blah blah blah";
s1 = "blah blah blah";
s2 = "blah blah blah";
s3 = "blah blah blah";
s4 = "blah blah blah";
modpage = "blah blah blah";
download = "blah blah blah";
name = "blah blah blah";

stuff = new Bundle();
stuff.putString("description", desc);
stuff.putString("maker", owner);
stuff.putString("screen1", s1);
stuff.putString("screen2", s2);
stuff.putString("screen3", s3);
stuff.putString("screen4", s4);
stuff.putString("officialmodpage", modpage);
stuff.putString("downloadlink", download);
stuff.putString("modname", name);

launchAct = new Intent(this, blahblahblah.class);
launchAct.putExtras(stuff);
startActivity(launchAct);
break;


Different items have different disc, owner etc.. And all of these strings are passed to an activity..All items in the listview pass these string to the same activity


I want the listview item to show only a title like : "BLAH" and once that item is clicked,I want all the data associated with the item to pass to the next activity...


Any tutorials or help would be much appreciated! :)





Aucun commentaire:

Enregistrer un commentaire