Я успешно сделал мои объявления admob на примере кода, предоставленного Google, по адресу http://code.google.com/mobile/ads/docs/android/fundamentals.html, но когда дело доходит до моего собственного приложения, они не отображаются.Объявления admob не отображаются
Я прочитал некоторые связанные вопросы, но, похоже, это не проблема для LinearLayout, которую я использую. Одно замечание заключается в том, что в моем приложении он расширяет ListActivity вместо Activity.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/com.mypackage.myapp"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2">
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
ads:adUnitId="myadmobid"
ads:adSize="BANNER"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2">
<TextView
android:id="@+id/hottopictab"
android:text="Deal"
android:gravity="center_horizontal|center_vertical"
android:background="#000000"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textStyle="bold"
android:typeface ="sans"
android:layout_weight="1"/>
<TextView
android:id="@+id/newtopictab"
android:text="()"
android:gravity="center_horizontal|center_vertical"
android:background="#000000"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textStyle="bold"
android:typeface ="sans"
android:layout_weight="1"/>
<TextView
android:id="@+id/recommendtab"
android:text=""
android:gravity="center_horizontal"
android:background="#000000"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"/>
<ImageButton
android:layout_height="fill_parent"
android:id="@+id/refresh"
android:background="#000000"
android:src="@drawable/refresh"
android:layout_width="wrap_content"
android:layout_marginRight="6dip"
/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="40">
<ListView
android:id="@android:id/list"
android:text="row one"
android:textSize="15pt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
Я установил его как тестовую учетную запись. request.setTesting (истина); И я вижу, что моя учетная запись admod получает новые запросы время от времени, когда я запускаю/отлаживаю свое приложение. Как проверить логарифм? – Yang
Проверьте вкладку logcat в представлении DDMS в Eclipse. – Haphazard