2015-09-24 90 views
3

我嘗試將Facebook橫幅添加到我的Android應用中。它適用於我的LG D-405,但用三星Galaxy S5返回「廣告重新加載得太頻繁」。Facebook觀衆網絡返回錯誤「廣告重新加載得太頻繁」

adView = new AdView(getActivity(), "-------", AdSize.BANNER_HEIGHT_50); 
     adView.setAdListener(new AdListener() { 
      @Override 
      public void onError(Ad ad, AdError adError) { 
       if(getActivity()!=null) { 
        ((MyApplication) getActivity().getApplication()).getDefaultTracker().send(
          new HitBuilders.EventBuilder() 
            .setCategory("Facebook AdView") 
            .setAction("error") 
            .setLabel(adError.getErrorMessage()) 
            .setValue((long) adError.getErrorCode()) 
            .build() 
        ); 
       } 
      } 

      @Override 
      public void onAdLoaded(Ad ad) { 
       if(!layout.getChildAt(2).equals(adView)) { 
        layout.addView(adView, 2, new LinearLayout.LayoutParams((int) (AdSize.BANNER_HEIGHT_50.getWidth() * MainActivity.density), (int) (AdSize.BANNER_HEIGHT_50.getHeight() * MainActivity.density))); 
       } 
      } 

      @Override 
      public void onAdClicked(Ad ad) { 

      } 
     }); 
     //adView.disableAutoRefresh(); 
     adView.loadAd(); 
+0

你有什麼解決辦法嗎? –

+0

嘿,你知道disableAutoRefresh的相反嗎? –

回答

相關問題