title: Admob ad never displays in View
body: <p>I am trying to get AdMob ads to display in my android application and have been unable to do so. I have contacted their support and have not received any response in almost a week, so I figured I would now ask for help here.</p>
  
  <p>First some code:<br>
  <code>AndroidManifest.xml</code></p>
  
  <pre><code>&lt;manifest 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:versionCode="1" package="com.foo.application"&gt;
    &lt;application&gt;
      &lt;meta-data 
          android:value="admob-publisher-id-here" 
          android:name="ADMOB_PUBLISHER_ID" /&gt;
    &lt;/application&gt;
  
    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Yes, <strong>admob-publisher-id-here</strong> is my real publisher id in the actual manifest file.</p>
  
  <p><code>main_layout.xml</code></p>
  
  <pre><code>&lt;LinearLayout 
      android:id="@+id/adhost" 
      android:layout_width="fill_parent"
      android:padding="5dip" android:layout_height="wrap_content"
      android:minHeight="20dip" 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res/com.foo.application"&gt;
    &lt;com.admob.android.ads.AdView 
        android:id="@+id/ad" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        app:backgroundColor="#000000" 
        app:primaryTextColor="#FFFFFF" 
        app:secondaryTextColor="#CCCCCC"
        app:keywords="android at&amp;amp;t t-mobile iphone blah"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><code>attr.xml</code></p>
  
  <pre><code>&lt;resources&gt;
    &lt;declare-styleable name="com.admob.android.ads.AdView"&gt;            
      &lt;attr name="backgroundColor" format="color" /&gt;
      &lt;attr name="primaryTextColor" format="color" /&gt;
      &lt;attr name="secondaryTextColor" format="color" /&gt;
      &lt;attr name="keywords" format="string" /&gt;
      &lt;attr name="refreshInterval" format="integer" /&gt;
    &lt;/declare-styleable&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p><code>MainActivity.java</code></p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import com.admob.android.ads.AdManager;
  import com.admob.android.ads.AdView;
  
  import com.foo.application.R;
  
  public class MainActivity extends Activity {
    private AdView ad;
  
    public MainActivity ( ) {
          AdManager.setTestDevices ( new String[] {
        // made this up for this
              "012345678994814751742145548AAAAAAA" 
          } );
          AdManager.setTestAction ( "url" );
      }
  
      @Override
      public void onCreate ( Bundle savedInstanceState ) {
        super.onCreate ( savedInstanceState );
          setContentView(R.layout.main_layout);
  
          if ( AdManager.isTestDevice ( this ) ) {
            // this logs
              Log.w ( "foo-app", "we are on a test device" );
          }
  
          ad = ( AdView ) this.findViewById ( R.id.ad );
          if ( ad != null ) {
              ad.setVisibility ( View.VISIBLE );
              ad.setAdListener ( new AdListener () );
          }
      }
  }
  </code></pre>
  
  <p><code>AdListener.java</code></p>
  
  <pre><code>package com.foo.application
  
  import android.util.Log;
  
  import com.admob.android.ads.AdView;
  import com.admob.android.ads.SimpleAdListener;
  
  class AdListener extends SimpleAdListener {
      @Override
      public void onFailedToReceiveAd ( AdView adView ) {
        // this is what logs
          Log.w ( "foo-app", "failed to receive ad" );
          super.onFailedToReceiveAd ( adView );
      }
  
      @Override
      public void onFailedToReceiveRefreshedAd ( AdView adView ) {
          Log.w ( "foo-app", "failed to receive refreshed ad" );
          super.onFailedToReceiveRefreshedAd ( adView );
      }
  
      @Override
      public void onReceiveAd ( AdView adView ) {
          Log.w ( "foo-app", "receive ad" );
          super.onReceiveAd ( adView );
      }
  
      @Override
      public void onReceiveRefreshedAd ( AdView adView ) {
          Log.w ( "foo-app", "receive refreshed ad" );
          super.onReceiveRefreshedAd ( adView );
      }
  }
  </code></pre>
  
  <p>In the logcat, i see the following:</p>
  
  <pre><code>INFO/AdMobSDK(29541): To get test ads on this device use AdManager.setTestDevices( new String[] { "012345678994814751742145548AAAAAAA" } )
  WARN/AdMobSDK(29541): Ignoring requestFreshAd() because we are requesting an ad right now already.
  WARN/AdMobSDK(29541): Ignoring requestFreshAd() because we are requesting an ad right now already.
  WARN/foo-app(29541): we are on a test device
  WARN/foo-app(29541): failed to receive ad
  </code></pre>
  
  <p>The AdListener is indicating that it is unable to retrieve the ad. I have an active data connection, plus I am in Test Mode, so it is supposed to always show an ad, according to the <a href="http://developer.admob.com/wiki/Android#SDK_Integration_Instructions" rel="nofollow noreferrer">admob wiki</a>. There are no errors in the logcat, nor is the application force closing at all. </p>
  
  <p>Anyone have any ideas or do you see something I am doing wrong?</p>
  
  <p><strong>update: I got a response from admob, but all they said was i was creating the aeveiw twice, which I am not</strong></p>