I\'m inserting an AdMob in my application. but I have a problem about it.
when I inserted some codes about it in Eclipse, I can see an error message about \"the con
Change your layout in this way:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.android.ads.AdView
android:id="@+id/fragment_03_admob"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:adSize="BANNER"
app:adUnitId="@string/activity_admobID"
app:loadAdOnCreate="true"
app:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" />
</LinearLayout>
You was using a wrong namespace declaration.
You have to write root before the findViewById
:
AdView mAdView = (AdView) root.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);