facebook interstitialad在Android应用中不显示关闭按钮

时间:2016-04-27 06:56:58

标签: android facebook advertisement

出于某种原因,facebook interstitialad在我的Android应用程序中不显示关闭按钮。我遵循了https://developers.facebook.com/docs/audience-network/android/interstitial

的所有步骤

但是,使用后退按钮可以正确关闭广告。但我需要显示关闭按钮,有什么帮助吗?

第一张图片: Image 1

第二张图片: Image 2

以下是负责本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();
    }   
}

0 个答案:

没有答案