I've got an ArrayAdaptor to add onClick listeners to items.

The logging in here says it adds them to every item.
Some items that I press seem OK, with others the click is not logged,
and the click goes through to the list (I can see the highlight, but
it doesn't register my button presses).

Any idea what I'm going wrong ?


Heres how I setup my listeners (for buttons with id thumb, play, save
and delete):

        public View getView(int position, View  convertView, ViewGroup
parent) {
                int[] buttons = new int[] { R.id.thumb, R.id.play, R.id.save,
R.id.delete};
                if (convertView != null) for(int buttonId: buttons) {
                        View button = convertView.findViewById(buttonId);
                        if (button != null) {
                                button.setClickable(true);
                                button.setFocusable(true);
                                button.setOnClickListener(this);


                                Log.i("Add Listener", "" + (Video) 
getItem(position));
                                button.setTag(getItem(position)); // Add Video 
as tag
                        }
                }
                return super.getView(position, convertView, parent);
        }

        @Override
        public boolean  areAllItemsEnabled() {
            return true;
        }

        @Override
        public boolean isEnabled(int position) {
                return true;
        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to