내 앱은 앱에 삽입 광고를 표시하고 인터넷 속도가 느려 앱이 닫힌 후에 표시 될 수 있습니다. 앱이 종료 된 후 삽입 광고를 표시하면 admob 규칙을 위반하게됩니다. 앱 폐쇄 후 삽입 광고가 광고를 게재하지 못하게하려면 어떻게해야합니까 ??앱 종료 후 삽입 광고 게재를 중지하는 방법은 무엇입니까?
public class des extends AppCompatActivity {
ImageButton imageView15;
InterstitialAd mInterstitialAd;
private InterstitialAd interstitial;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_des);
AdView mAdView = (AdView) findViewById(R.id.AdView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
// Prepare the Interstitial Ad
interstitial = new InterstitialAd(des.this);
// Insert the Ad Unit ID
interstitial.setAdUnitId(getString(R.string.intertitial_id));
interstitial.loadAd(adRequest);
// Prepare an Interstitial Ad Listener
interstitial.setAdListener(new AdListener() {
public void onAdLoaded() {
// Call displayInterstitial() function
displayInterstitial();
}
});
imageView15 = (ImageButton) findViewById(R.id.imageView15);
imageView15.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intentLoadNewActivity = new Intent(des.this,vid.class);
startActivity(intentLoadNewActivity);
}
});
}
public void displayInterstitial() {
// If Ads are loaded, show Interstitial else show nothing.
if (interstitial.isLoaded()) {
interstitial.show();
}
}
}
이
@Override
public void onDestroy()
{
super.onDestroy();
if (mInterstitialAd != null) {
mInterstitialAd.destroy();
}
}
당신이들의 OnDestroy 내 자바 코드를 편집 할 수있는 서비스 클래스를 포함하지 않는 메신저는하지하려고 할 때 때문에() 한 당신의 응용 프로그램을 종료하려 할 때마다
system.exit(0);
파괴 단어를 작동하는 것은 빨간색으로 바뀌고 나는 그것을 교정하는 방법을 모른다. alt + 앱을 새로 개발하는 새로운 앱을 입력한다. –onDestroy() 메소드 바로 가기 키 (Ctrl + O)를 오버라이드해야한다. –
블록 만 제거하면 –