Android Animated ImageView click event

时间:2015-07-28 23:16:35

标签: android image animated

I'll keep this short and to the point, How would I detect when a animated ImageView is clicked?

Right now I use the code below and it is triggered when I click the left top corner... because that's where the picture is before its animated.

    ImageView img = (ImageView) findViewById(R.id.bubble1);
    img.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
          start();
        }});

1 个答案:

答案 0 :(得分:0)

Well, my bet would be for you to use import java.awt.event.MouseEvent; import java.awt.event.MouseAdapter; import java.awt.event.*; import java.awt.*; class Mouseposition extends MouseAdapter { public void mouseMoved(MouseEvent e) { System.out.println("MOuse x : "+MouseInfo.getPointerInfo().getLocation().x+ "Mouse Y : "+MouseInfo.getPointerInfo().getLocation().y); } public static void main(String args[]) { //--- register for Mouse events ---- while(true); } } .

Try something like the following.

ontouch()