google play services - AdMob ad don't show -
my xml file
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:ads="http://schemas.android.com/apk/res-auto" android:id="@+id/quadro" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"`enter code here` android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".homeactivity" > <linearlayout android:id="@+id/linha01" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > </linearlayout> <linearlayout android:id="@+id/linha02" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > </linearlayout> <linearlayout android:id="@+id/linha03" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > </linearlayout> <linearlayout android:id="@+id/linha04" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" > </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center|left" > </linearlayout> <relativelayout android:id="@+id/linhaad" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <com.google.android.gms.ads.adview android:id="@+id/adview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" ads:adsize="banner" ads:adunitid="ca-app-pub-xxxxxx" /> </relativelayout> my code
protected void oncreate(bundle savedinstancestate) { /*... *code *...*/ adview = (adview)this.findviewbyid(r.id.adview); adrequest adrequest = new adrequest.builder() .addtestdevice(adrequest.device_id_emulator) .build(); adview.loadad(adrequest); } manifest xml
<uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.access_network_state"/> ... <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> ... <activity android:name="com.google.android.gms.ads.adactivity" android:configchanges="keyboard|keyboardhidden|orientation|screenlayout|uimode|screensize|smallestscreensize"/> when change background of ad appears black background, without text.the adview creates impressions in admob, don't show.i don't know can be
get rid of relativelayout. there no need , have set consume height of parent, not want.
Comments
Post a Comment