Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Finally sorted out the problem after 3 days trial and error. For some reason having the TextView and ListView in the same XML threw the adMob off. I removed the TextView and put it in its own XML Layout and the code now works. I then needed to change the view inflator from the XML containing the admob code to the XML containing the TextView code in all of my list activities.</p> <p>New Code</p> <p>Main XML</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;com.google.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adSize="BANNER" ads:adUnitId="ca-app-pub-9438516449663554/1376593424" ads:loadAdOnCreate="true" ads:testDevices="TEST_EMULATOR, 37ae14af62d03e19" /&gt; &lt;ListView android:id="@+id/list_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/sailor" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>main_row XML</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;TextView android:id="@+id/row" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/trans" android:padding="10dp" android:textColor="@color/menu_text" android:textSize="22sp" android:textStyle="normal" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>Activity Line</p> <p>View row = inflater.inflate(R.layout.main, parent, false);</p> <p>changed to</p> <p>View row = inflater.inflate(R.layout.main_row, parent, false);</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload