如何在用于逐帧动画的图像视图上实现触摸......我使用它如下
final AnimationDrawable newtonAnimation = (AnimationDrawable) animation.getBackground();
AnimationStart(newtonAnimation);
animation.setOnTouchListener(l);
public void AnimationStart(final AnimationDrawable newanimation){
Thread timer=new Thread(){
@Override
public void run(){
try{
sleep(40);
}catch(Exception e){}
finally{
Newton_LawsActivity.this.runOnUiThread(new Runnable() {
public void run(){
newanimation.start();
}});
}
}
};
timer.start();
这就是我得到 ontouch 事件的地方......
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
Log.w("debug","nullis event"+event+"OR"+gestureDetector.onTouchEvent(event));
return gestureDetector.onTouchEvent(event);
}