当玩家触摸 adwhirl 横幅的广告时,我想做一个动作(增加一个计数器)。我已经看到 AdWhirl 类有一个每次触摸都会调用的方法:
//We intercept clicks to provide raw metrics
public boolean onInterceptTouchEvent(MotionEvent event) {
switch(event.getAction()) {
//Sending on an ACTION_DOWN isn't 100% correct... user could have touched down and dragged out. Unlikely though.
case MotionEvent.ACTION_DOWN:
Log.d(AdWhirlUtil.ADWHIRL, "Intercepted ACTION_DOWN event");
countClickThreaded();
if(activeRation.type == 9) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(custom.link));
this.context.startActivity(intent);
}
break;
}
// Return false so subViews can process event normally.
return false;
}
好吧,我该如何使用它?我应该实现一个监听器吗?或者也许是一个像这样实现 AdWhirlInterface 的类?处理 AdWhirl onFailure
我真的不知道如何移动:(