2017-07-02 59 views
0

我想知道,使用FirebaseRecyclerAdapter以實現recyclerview AdMob原生廣告明確落實在recyclerview AdMob原生廣告快遞,請提供詳細的答案,如果你能,在此先感謝如何使用FirebaseRecyclerAdapter

+0

你試過做什麼? – Vyacheslav

+0

我什麼也沒得到,我需要幫助 – Umesh

+1

你應該顯示你先做了什麼。人們不希望爲你做這項工作 –

回答

0

嘗試在viewholder類此

protected void populateViewHolder(YourViewHolder viewHolder, myModel model, int position) { 

     //Native Ads 
     viewHolder.loadNativeAd(nativeRequest); 

public NativeExpressAdView nativeAdview; 

public YourViewHolder(View view) { 
    super(view); 

    nativeAdview = (NativeExpressAdView) view.findViewById(R.id.nativeAdView); 
} 

public void loadNativeAd(AdRequest nativeRequest){ 
    if(nativeAdview != null) { 
     nativeAdview.loadAd(nativeRequest); 
     nativeAdview.setAdListener(new AdListener() { 
      @Override 
      public void onAdLoaded() { 
       super.onAdLoaded(); 
       nativeAdview.setVisibility(View.VISIBLE); 
      } 
     }); 
    } 
} 

然後從適配器加載

相關問題