我想让我的广告(Admob)每分钟刷新一次,但每次尝试刷新我都会得到这个:
02-19 11:31:01.209: INFO/Ads(23514): Received ad url: <"url": "http://googleads.g.doubleclick.net:80/mads/gma?preqs=1&u_sd=1&slotname=a14dffcf49bd166&u_w=768&msid=m.s&cap=m&js=afma-sdk-a-v4.3.1&mv=8010004.com.android.vending&isu=16252B9186250264A14DCFAC778270C6&cipa=0&format=320x50_mb&net=wi&app_name=1.android.m.s&hl=en&u_h=1024&u_audio=1&prl=4712&u_so=p&output=html®ion=mobile_app&u_tz=300&ex=1&client_sdk=1&askip=1&pto=0&caps=GmsgVideoPlayer_SdkAdmobApiForAds&jsv=3", "afmaNotifyDt": "null">
02-19 11:31:01.219: WARN/Ads(23514): IOException connecting to ad url.
02-19 11:31:01.219: WARN/Ads(23514): java.io.IOException: Bad file number
02-19 11:31:01.219: WARN/Ads(23514): at org.apache.harmony.luni.platform.OSFileSystem.ioctlAvailable(Native Method)
02-19 11:31:01.219: WARN/Ads(23514): at dalvik.system.BlockGuard$WrappedFileSystem.ioctlAvailable(BlockGuard.java:241)
02-19 11:31:01.219: WARN/Ads(23514): at org.apache.harmony.luni.net.PlainSocketImpl.available(PlainSocketImpl.java:152)
02-19 11:31:01.219: WARN/Ads(23514): at org.apache.harmony.luni.net.SocketInputStream.available(SocketInputStream.java:48)
02-19 11:31:01.219: WARN/Ads(23514): at java.io.BufferedInputStream.available(BufferedInputStream.java:112)
02-19 11:31:01.219: WARN/Ads(23514): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.isStale(HttpConnection.java:222)
02-19 11:31:01.219: WARN/Ads(23514): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:77)
02-19 11:31:01.219: WARN/Ads(23514): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
02-19 11:31:01.219: WARN/Ads(23514): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
02-19 11:31:01.219: WARN/Ads(23514): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:205)
02-19 11:31:01.219: WARN/Ads(23514): at com.google.ads.b.run(SourceFile:280)
02-19 11:31:01.219: WARN/Ads(23514): at java.lang.Thread.run(Thread.java:1019)
我该如何解决这个问题?
以下是我用来设置AdView的代码:
SurfaceView view = new SurfaceView(this);
AdView v = new AdView(this, AdSize.BANNER, "my code");
v.loadAd(new AdRequest());
RelativeLayout e = new RelativeLayout(this);
e.addView(view);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
params.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);
v.setLayoutParams(params);
e.addView(v);
setContentView(e);