AdWhirl touch intercept

╄→гoц情女王★ 提交于 2020-01-06 07:58:16

问题


I'd like to make an action (increment a counter) when a player touch the ad of the adwhirl banner. I've seen that the AdWhirl class have a method that is called every touch:

//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;
    }

Well, how can I use it? Should I implement a listener? Or maybe a class that implements the AdWhirlInterface like this one? Handle AdWhirl onFailure

I really don't know how to move :(


回答1:


Check out the adWhirlClickMetric method of the library and see when it is called. It is called whenever a user touches an ad banner (in the iOS version of the SDK at least) and would be perfect for what you want to do.



来源:https://stackoverflow.com/questions/5902640/adwhirl-touch-intercept

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!