I am using the Admob Native Ads template given at the documentation page in my App. The layout of the Ad is working fine but the test ads are not showing, I hope it because of the code I have used and I am showing it below, pls help me with you valuable opinions about the fault.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});
//Native
AdLoader.Builder builder = new AdLoader.Builder(this,getString(R.string.NativeAd1));
builder.forUnifiedNativeAd(new UnifiedNativeAd.OnUnifiedNativeAdLoadedListener() {
@Override
public void onUnifiedNativeAdLoaded(UnifiedNativeAd unifiedNativeAd) {
TemplateView templateView = findViewById(R.id.Native_temp);
templateView.setNativeAd(unifiedNativeAd);
}
});
AdLoader adLoader = builder.build();
AdRequest adRequest = new AdRequest.Builder().build();
adLoader.loadAd(adRequest);