views:

146

answers:

3

I have a ListView in Screen 1 where I have a few items . The User Clicks on an item in the Listview and Screen2 pops up . But What appears in Screen2 depends on what item was clicked in Screen 1

For Ex - User Clicks A in Screen 1 - Words starting from A come up in Screen 2

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

         // When clicked, Open the Next Screen
         Intent r=new Intent(Dummy.this ,CricksList.class );
         r.putExtra("extra", id);
         startActivityForResult(r, position);
         }

I have passed the item which was clicked on . But I want to Display on Screen 2 what the user clicked on - as an item in the List View . How do I do that ??

A: 

Use the extra field from the receiving intent, and based on that, lookup the record in your data source(database, contentprovider, array) and inflate a view that suit your needs.

Pentium10
A: 

Could you please put the source for this thing?

Actually i want to get the id of the clicked listview item on next screen.

Use the extra field from the receiving intent, and based on that, lookup the record in your data source(database, contentprovider, array) and inflate a view that suit your needs.

thanks chandu

chandu
A: 

try to create other activity which display clicked item. call second activity on click.

i am trying out this.

ud_an