FORUMS
Remove All Ads from XDA

how to change admob interstitial to load after 5 seconds when clicked button

7 posts
Thanks Meter: 0
 
By osmanoca, Junior Member on 13th July 2019, 04:53 PM
Post Reply Email Thread
Loading interstitial admob after 5 seconds. İ have a code for interstitial admob. now in my app it loads interstitial admob when i click about menu. But this makes problem for google admob. So they stopped my admob in this app. İ want to solve this with loading interstitial admob after 5 second when i click about menu. How can i change the code.

i dont know any code. please say me to add which code to my code.

This is "about java file" code:


import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.InterstitialAd;

public class About extends AppCompatActivity {
private String TAG = About.class.getSimpleName();
InterstitialAd mInterstitialAd;

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().hide();
getWindow().setFlags(WindowManager.LayoutParams.FL AG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_game_layout);
setContentView(R.layout.activity_about);

mInterstitialAd = new InterstitialAd(this);

// set the ad unit ID
mInterstitialAd.setAdUnitId(getString(R.string.int erstitial_full_screen));

AdRequest adRequest = new AdRequest.Builder()
.build();

// Load ads into Interstitial Ads
mInterstitialAd.loadAd(adRequest);

mInterstitialAd.setAdListener(new AdListener() {
public void onAdLoaded() {
showInterstitial();
}
});
}

private void showInterstitial() {
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
}
}

@override
protected void onStop() {
super.onStop();
finish();
}

}
 
 
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes