出于某种原因,facebook interstitialad在我的Android应用程序中不显示关闭按钮。我遵循了https://developers.facebook.com/docs/audience-network/android/interstitial
的所有步骤但是,使用后退按钮可以正确关闭广告。但我需要显示关闭按钮,有什么帮助吗?
以下是负责本AD的代码:
public class MyActivity extends SherlockFragmentActivity implements
SearchView.OnSuggestionListener, InterstitialAdListener {
private InterstitialAd interstitialAd;
boolean adDismissed;
private void loadInterstitialAd() {
interstitialAd = new InterstitialAd(this, "my_id");
interstitialAd.setAdListener(this);
interstitialAd.loadAd();
}
@Override
public void onAdLoaded(Ad ad) {
// Ad is loaded and ready to be displayed
// You can now display the full screen add using this code:
interstitialAd.show();
}
@Override
public void onAdClicked(Ad arg0) {
// TODO Auto-generated method stub
}
@Override
public void onInterstitialDismissed(Ad arg0) {
// TODO Auto-generated method stub
adDismissed = true;
}
@Override
public void onInterstitialDisplayed(Ad arg0) {
// TODO Auto-generated method stub
}
@Override
public void onError(Ad ad, AdError error) {
// Ad failed to load
}
@Override
public void onStart() {
super.onStart();
if(!adDismissed)
loadInterstitialAd();
}
}