Meryl Silverburgh wrote:
> Hi,
> 
> I have read the Gallery2.java example, which show how to map a
> Column's value to an elment in the view I want to create (in this
> case, it maps 'NAME' to text1 element0.
> But what if I have a Button in my view, how can I know which Person is
> being clicked? or how can I query the person's info when a button in
> the new is clicked?
> 
> From the Gallery2.java example:
>   SpinnerAdapter adapter = new SimpleCursorAdapter(this,
>         // Use a template that displays a text view
>                 android.R.layout.simple_gallery_item,
>                 // Give the cursor to the list adatper
>                 c,
>                 // Map the NAME column in the people database to...
>                 new String[] {People.NAME},
>                 // The "text1" view defined in the XML template
>                 new int[] { android.R.id.text1 });
> 
>         Gallery g = (Gallery) findViewById(R.id.gallery);

You may need to subclass SimpleCursorAdapter and override newView() and
bindView(), manually inflating your layouts and attaching
OnClickListener objects at that time.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books.html

--~--~---------~--~----~------------~-------~--~----~
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