In this code I am displaying list of room. and after click on any room
name then switches list is displayed. I want to know on which item
(1.e on room) user had clicked. How to do this?
On Dec 16, 10:36 am, "pramod.deore" <[email protected]> wrote:
> Hi, I want to know how to print name of parent item in expandableList.
> If suppose I have following code
>
>  public void onCreate(Bundle savedInstanceState)
>     {
>         super.onCreate(savedInstanceState);
>         sampleDB =  this.openOrCreateDatabase(SAMPLE_DBNAME,
> MODE_PRIVATE, null);
>
>         Cursor groupCursor = sampleDB.rawQuery ("SELECT _id,
> RoomName ,SwitchFullName FROM SwitchTable GROUP BY RoomName",null);
>
>         // Cache the ID column index
>         mGroupIdColumnIndex =
> groupCursor.getColumnIndexOrThrow("_id");
>
>         idVal  =
> groupCursor.getInt(groupCursor.getColumnIndex("_id"));
>
>         System.out.println ("^^^^^^"+idVal);
>         // Set up our adapter
>         mAdapter = new MyExpandableListAdapter(groupCursor,
>                 this,
>                 android.R.layout.simple_expandable_list_item_1,
>                 android.R.layout.simple_expandable_list_item_2,
>                 new String[] {"RoomName"}, // Name for group layouts
>                 new int[] {android.R.id.text1},
>                 new String[] {"SwitchFullName"}, // Number for child
> layouts
>                 new int[] {android.R.id.text1});
>         setListAdapter(mAdapter);
>     }
>
> Now I want to print the name of parent on which user click. How to do
> this?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to