I got an image on which I set OnTouchListener. When the person moves his finger away from the image, I need to check in which view he lifted the finger(or at least whether he was in same image when lifted finger). I read this and the answer was based on pixel color. Isn't there any way I can get the id of the view in which I lifted the finger? Or some flag which tells me whether I was in same view on which I implemented the OnTouchListener?
This is a little code in which I tried to compare the id of view on ACTION_UP, but it appears to be the same on which I implemented the listener....
tmw2 = (ImageView) findViewById(R.id.temp2);
tmw2.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
if (arg1.getAction() == MotionEvent.ACTION_UP) {
if (arg0.getId() == R.id.temp2)
tmw2.setImageResource(R.drawable.downloads_pressed);
}
return false;
}
});