I have a problem with google adview… it’s not showing up. I dug around a for a while and saw that people where having issues with padding, so I removed the padding and still no luck.
Here is my relevant manifest data:
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
<meta-data
android:value="a14d91b10f12454"
android:name="ADMOB_PUBLISHER_ID" />
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
And my XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent" android:background="@drawable/greygradient">
<ScrollView android:id="@+id/scrollView1" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_above="@+id/linearLayout2" android:padding="15dp">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">
<LinearLayout android:orientation="horizontal" android:layout_height="wrap_content" android:layout_width="fill_parent" android:padding="5dp">
<ImageView android:src="@drawable/icon" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/imageviewdetail"></ImageView>
<TextView android:text="TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginLeft="5dp" android:id="@+id/textviewdetailname" android:textSize="18dp"></TextView>
</LinearLayout>
<!-- Snip -->
</LinearLayout>
</ScrollView>
<LinearLayout android:id="@+id/linearLayout2" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentBottom="true" android:orientation="vertical">
<Button android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Sign Up!" android:id="@+id/buttondetailsubmit" android:layout_margin="15dp" android:layout_marginTop="10dp" ></Button>
<com.google.ads.AdView android:id="@+id/googleads" android:layout_width="fill_parent" android:layout_height="wrap_content"></com.google.ads.AdView>
</LinearLayout>
And finally, the code that is running the ad:
AdView ad = (AdView)findViewById(R.id.googleads);
ad.setEnabled(true);
ad = new AdView(this, AdSize.BANNER, "a14d91b10f12454");
AdRequest r = new AdRequest();
r.setTesting(true);
ad.loadAd(r);
In my LogCat, it shows that I am recieving ads. And in AdMob admin panel you can see that there have been successful requests made.. but I cannot get the stupid view to actually show up!
Anyone help?
You aren’t adding the AdView to your layout when you create the new AdView with
You should remove the AdView from the xml and do this.