Android – displays non on page ads after a certain number of clicks

I want to display the AdMob insert ad when the user clicks the button. But I don't want to display the ad every time the user clicks the button. I want to display it every 3-5 times after the user clicks the button

resolvent:

final int clickNumber = 0;
Button mButton = (Button)findViewById(R.id.button);
mButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                 if(clickNumber<=5){
                   clickNumber++;
                 }else{
                      clickNumber=0;
                      // show add here
                 }
            }
         });

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>