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);

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! :)


You can Simply use the OnClickListener

As here

list.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {

       Object o = prestListView.getItemAtPosition(position);
       prestationEco str=(prestationEco)o;//As you are using Default String Adapter

But before that you have to create the list.

You can get details from Here

Please feel free to ask any thing else.

Hope it help.



 ? Generating dynamic HTML pages with PHP
 ? Create javascript / jquery function to use in certain way
 ? C# <-> PHP dynamic AES key exchange
 ? Dynamic element in jade mixin
 ? How do I use a variable as a regex modifier in perl?
 ? How can I create an interface like this?
 ? Dynamically set comparison rules in a conditional?
 ? Organizing and Calling C# Methods Dynamically
 ? How can I use Express to render dynamic files?
 ? NSProgressIndicator progress with For loops?