Real Admob Ads Appearing When Setting Test Mode Programmatically

XRS

New Member
Kind of a strange issue here: Whenever I set test mode via xml, I receive the expected test ads in my emulator. However, when I try to do the same programmatically, I seem to get real ads. According to the Admob documentation, these two methods should be equivalent, no? Here is my xml code:\[code\] <com.google.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="xxxxxxxxxxx" ads:loadAdOnCreate="true"> </com.google.ads.AdView>\[/code\]And here is the relevant Java code:\[code\]@Overridepublic void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); AdRequest adRequest = new AdRequest(); adRequest.addTestDevice(AdRequest.TEST_EMULATOR);}\[/code\]As mentioned before, if I insert the line ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" into the above xml code, I get the test ad just fine. Any ideas?
 
Back
Top