Reputation: 69
I have three small ImageView on Screen/View. OnTouch and onTouchMove I have to detect that the Touch/Mouse has collide the ImageView.
Upvotes: 0
Views: 1401
Reputation: 4258
Use it for getting it.
@Override
public boolean onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
int action=(int)event.getAction();
return super.onTouchEvent(event);
}
event.getAction();
return three value.
0-MouseDown
1-MouseUp
2-MouseDrag
using this you can determine Touch/Mouse or collide.
Upvotes: 1
Reputation: 38168
imageView.setOnClickListener( new OnClickListener() {
@Override
public void onClick( View v )
{
System.out.println( "touched" );
}//met
});
Upvotes: 0