I haven't tried it, but perhaps another listener to detect the x coordinate of the click? (The more complicated y coordinate could be ignored if the image fills the row height.)
On Jul 30, 8:09 pm, Hari <mba.for.d...@gmail.com> wrote: > Hi Greg, > I gave a thought to that approach as well. I want the image selection > dialog to come up only when the user clicks on the image view. > > With onItemClick handler, the dialog pops up when user clicks any > section of the list item. How do i make sure that the dialog pops up > only when the user clickes on the Image. > > Regards > Hari > > On Jul 30, 7:26 pm, greg <sep...@eduneer.com> wrote: > > > I also use theEfficientAdapterBaseAdapter in my ListView. Is it not > > possible for you to use the onItemClick handler, which provides the > > list index (i.e., position), to implement your image change? (That's > > what I do.) > > > On Jul 30, 6:45 pm, Hari <mba.for.d...@gmail.com> wrote: > > > > Hi Mark, > > > Thanks for the Reply. > > > > I might have not stated my question properly. > > > > I have implemented another functionality for onListItemClick(). > > > > Each list item has aImageViewand i want the user to be able to > > > change this image by selecting from phone's gallery or by taking a > > > snap. So i have an onClicklistener() for the image view. How can i > > > know whichListItemwas clicked? I also would like to update the > > > database for thisListItemto save the image byte[] in blob column. > > > For this reason i have to know the item that was clicked. > > > > Regards > > > Hari > > > > On Jul 29, 8:31 pm, Mark Murphy <mmur...@commonsware.com> wrote: > > > > > The View passed into onListItemClick() is the row. Call findViewById() > > > > on that View to retrieve yourImageView. > > > > > On Thu, Jul 29, 2010 at 8:29 PM, Hari <mba.for.d...@gmail.com> wrote: > > > > > Hi, > > > > > I have implemented a "EfficientAdapter". Each list item is a > > > > > LinearLayout of a combination of image and text views. This > > > > >EfficientAdapteris attached to a Array<CustomObject>. Code snippet is > > > > > below: > > > > > > [code] > > > > > public class ExampleList extends ListActivity { > > > > > private classEfficientAdapterextends BaseAdapter { > > > > > ......... > > > > > public View getView(int position, View convertView, ViewGroup > > > > > parent) { > > > > > .......... > > > > > //Make the ICON Clickable > > > > > holder.icon.setOnClickListener(mCorkyListener); > > > > > } > > > > > > class ViewHolder { > > > > > ...... > > > > > TextView dateRange; > > > > > ImageViewicon; > > > > > ..... > > > > > } > > > > > } > > > > > > 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 togetahandleto 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 > > > > > android-developers@googlegroups.com > > > > > To unsubscribe from this group, send email to > > > > > android-developers+unsubscr...@googlegroups.com > > > > > 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/commonsguyhttp://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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en