开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜