ListActivity に対応する次の XML ファイルがあります。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/classview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="xxxx" >
</com.google.ads.AdView>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
そして、ListActivity 内からこの Java コードを呼び出します。
public void setupAd(){
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice("xxxx");
AdView adView = (AdView) findViewById(R.id.adView);
adView.loadAd(adRequest);
}
XML ファイルのグラフィカル レイアウトを見ると、ListView の上に広告バナーがきちんと配置されているように見えます。ただし、実際のアプリを実行すると、ListView が画面全体を占有しているように見え、広告がブロックされる可能性があります。誰が何が悪いのか知っていますか?