Android : AdMob onClickListener

后端 未结 4 774
忘掉有多难
忘掉有多难 2021-01-03 03:15

I display into my android application AdMob\'s banners. I would like that when the user click on the banner it gone. I have try the code AdView.setOnC

4条回答
  •  长发绾君心
    2021-01-03 03:54

    I can help you with AdWhirl adds.

    I have seen sources and have done next:

    public class AdWhirlLayoutCustom extends AdWhirlLayout {
    
    public AdWhirlLayoutCustom(Activity context, String keyAdWhirl) {
        super(context, keyAdWhirl);
    }
    
    public AdWhirlLayoutCustom(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    
    // We intercept clicks
    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        boolean result = super.onInterceptTouchEvent(event);
        switch (event.getAction()) {
    
        case MotionEvent.ACTION_DOWN:
                        // Click!
            break;
        }
    
        return result;
    }
    

    }

提交回复
热议问题