The View passed into onListItemClick() is the row. Call findViewById()
on that View to retrieve your ImageView.

On Thu, Jul 29, 2010 at 8:29 PM, Hari <[email protected]> wrote:
> Hi,
> I have implemented a "EfficientAdapter". Each list item is a
> LinearLayout of a combination of image and text views.  This
> EfficientAdapter is attached to a Array<CustomObject>. Code snippet is
> below:
>
> [code]
> public class ExampleList extends ListActivity {
>  private class EfficientAdapter extends BaseAdapter {
>    .........
>      public View getView(int position, View convertView, ViewGroup
> parent) {
>           ..........
>           //Make the ICON Clickable
>          holder.icon.setOnClickListener(mCorkyListener);
>      }
>
>      class ViewHolder {
>            ......
>            TextView dateRange;
>            ImageView icon;
>            .....
>        }
>  }
>
>  public void onCreate(Bundle savedInstanceState) {.....}
>
>  protected void onListItemClick(ListView l, View v, int position,
> long id) {.....}
>
>  public OnClickListener mCorkyListener = new OnClickListener() {
>        public void onClick(View v) {
>                // do something when the button is clicked
>                Log.i("Item ID", v.getId()+"");
>                captureImage();
>    }};
>
>   .................
>  }
> [/code]
>
> The captureImage() method brings up the option for user to select an
> image from Gallery or click a snap.
>
> My Problem:
> "I DO NOT KNOW" how to get a handle to the image in the list item that
> was clicked. I will have refresh the image view with what ever image
> was selected by the user.
>
> Any leads or pointers in resolving this issue is greatly appreciated
>
> Thanks
> Hari
>
> --
> 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
>



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

_Android Programming Tutorials_ Version 2.9 Available!

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