0
在我onCreate
,我的代碼:儘快顯示AdMob插頁,因爲它被裝載
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId("ca-app-pub-1852329945819279/4025192744");
// Create ad request.
AdRequest adRequest1 = new AdRequest.Builder().build();
// Begin loading your interstitial.
interstitial.loadAd(adRequest1);
哪裏「間隙」是private InterstitialAd interstitial
。
public void displayInterstitial() {
runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
if (interstitial.isLoaded()) {
interstitial.show();
}
resetInterstitial();
}
});
}
如何顯示的間隙(稱之爲displayInterstitial()
方法)只要填隙被加載:
我然後使用以下方法展示插頁?所有幫助讚賞。