I have a gridview with custom views in it. The custom views are view that contain a few buttons. When I onItemClick the gridview to create the custom view, everything works fine, the GridView understands what I am trying to do; but as soon as I onItemLongClick a custom view (that has been created due to an onItemClick), it doesn’t register at all. I don’t get it, I’m always returning true at the end of the longClick. But if I fill the gridview with a simple image view, both types of click work…
As far as I’ve read from the android UI handling article all listeners will trickle top-down, so I figured that the event would fire at the gridview before hitting the custom view…
Any thoughts or Ideas?
@Override public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
Log.e("Grid", "Log long click");
mSelect = pos;
mHold = Bitmap.createScaledBitmap(mGridWidgets[pos].toBitmap(), getWidth()/2, getHeight()/2, true);
mIsHolding = true;
setOnTouchListener(mToucher);
Log.e("Grid", mSelect + "");
mBoundService.vibrator.vibrate(150);
return true;
}
I t’was stupid. I needed to intercept the MotionEvent.