How to make an inter-page ad when clicking on a button? Below is the code. Where are the mistakes made? Did according to the instructions of Admob. Please correct.
public class MainActivity extends AppCompatActivity { InterstitialAd mInterstitialAd; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mInterstitialAd = new InterstitialAd(this); mInterstitialAd.setAdUnitId("ca-app-pub-9777249340958310/3008582982"); requestNewInterstitial (); mInterstitialAd.setAdListener(new AdListener() { @Override public void onAdClosed() { requestNewInterstitial(); } }); } private void requestNewInterstitial() { requestNewInterstitial(); } public void onClick(View view) { if (mInterstitialAd.isLoaded()) { mInterstitialAd.show(); } else { } } }
{}button - Nick Volynkin ♦