0
I’m using this code:
<com.google.android.gms.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="MY_AD_UNIT_ID"
ads:adSize="BANNER"/>
Initialization:
// Consultar o AdView como um recurso e carregar uma solicitação.
AdView adView = (AdView)this.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
But you make a mistake:
Description Resource Path Location Type error: No Resource Identifier found for attribute 'loadAdOnCreate' in package 'com.teste.teste1' activity_teste.xml /Teste/res/layout line 120 Android AAPT Problem
this error I have already fixed, my code is the same as the one quoted in Graphical Layout where the BANNER is written in red
XML Required attribute " adSize " was Missing
Error says you have not set the attribute
loadAdOnCreate
in hisAdView
– Wakim
and how I defined this attribute if you can help me
– Vale
Could put the boot code?
– Wakim
@Wakim take a look at my issue
– Vale
You declared the
namespace
ads somewhere?– Paulo Rodrigues
I don’t understand your question
– Vale
He meant if he declared:
xmlns:ads="http://schemas.android.com/apk/res-auto"
somewhere above theAdView
.– Wakim