how can we get popup by touching on particular image i n android?? code will be better help for me
how can we get popup by touching on开发者_运维技巧 particular image and popup should be cancel by moving out from image in android?? code will be better help for me...
<ImageViewName>.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if(event.getAction()==0)//0-ACTION_DOWN
{
Toast.makeText(<Current Activity>.this, "Image is Pressed", Toast.LENGTH_SHORT).show();
}else
if(event.getAction()==1)//0-ACTION_UP
{
}
return false;
}
});
Through the above code we can display a pop up msg.In my code i am display a simple message.
精彩评论