2011-02-01 81 views
2

我遇到了AdView问题。当我开始活动这一观点,它看起来像某事的永恒循环,我看到了很多日志appearence的:Android + AdMob问题

02-01 21:57:34.437: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.512: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.512: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.587: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.587: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.657: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.657: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.727: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.727: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.797: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.802: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.872: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:34.887: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:35.002: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:35.092: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:35.092: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:35.172: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:35.172: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:35.267: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:35.267: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 
02-01 21:57:35.527: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already. 

很多很多很多次

这里是可以布局这一个:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:sac="http://schemas.android.com/apk/res/com.myapp" 
       android:orientation="vertical" android:layout_width="fill_parent" 
       android:layout_height="fill_parent"> 

    <com.google.android.maps.MapView 
      android:id="@+id/mapview" android:layout_width="fill_parent" 
      android:layout_height="fill_parent" android:clickable="true" 
      android:apiKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" /> 

    <Button android:layout_width="wrap_content" android:id="@+id/bFlashLight" 
      android:lines="1" android:ellipsize="end" android:textSize="18sp" 
      android:layout_height="wrap_content" android:padding="10dp" 
      android:textColor="#000" android:drawablePadding="10dp" 
      android:gravity="center" android:layout_alignBottom="@id/mapview" 
      android:text="@string/open_flashlight" /> 

    <ZoomControls android:id="@+id/zoomcontrols" 
        android:layout_width="wrap_content" android:layout_height="wrap_content" 
        android:layout_toRightOf="@id/bFlashLight" android:layout_alignBottom="@id/mapview" /> 

    <com.admob.android.ads.AdView android:id="@+id/ad" 
            android:layout_width="fill_parent" android:layout_height="wrap_content" 
            sac:backgroundColor="#000000" sac:primaryTextColor="#FFFFFF" 
            sac:secondaryTextColor="#CCCCCC" android:layout_alignParentTop="true" /> 
</RelativeLayout> 

有没有办法可以禁用requestFreshAd()方法的自动调用?

+0

你手动调用代码的广告或者你只使用xml?另外,外部布局是什么样子的,他们都是线性布局的派对吗? – sgarman 2011-02-01 20:10:45

回答

0

问题是由库的更新resovied

3

只选择单独的线性布局添加以下代码和刷新时间提AdMob网站或我们的代码提交其工作

<LinearLayout 
     xmlns:myapp="http://schemas.android.com/apk/res/com.myapp" 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:gravity="center_horizontal" 
     android:layout_height="wrap_content"> 
    <com.admob.android.ads.AdView 
     android:id="@+id/ad" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal"> 
     </com.admob.android.ads.AdView> 
</LinearLayout>