2 sachinks SachinKS 于 2013.03.22 14:43 提问

canvas绘图中的adMob 出错

为了绘制设了几个独立的类,我想通过abMob实现,从game类中调用然后将activity作为参数传递。

public void drawAddMob(Activity a){
LinearLayout ll = new LinearLayout(a);
ll.setPadding(0, 50, 0, 0);
adView = new AdView(a, AdSize.BANNER,  "a15140cd49b6e7b");  
AdRequest request = new AdRequest();
adView.loadAd(request);
adView.setVisibility(View.VISIBLE);

ll.addView(adView);

ll.draw(canvas);
}

结果出错:

03-21 23:35:09.646: W/System.err(333):
java.lang.RuntimeException: Can't create handler 
inside thread that has not called Looper.prepare()
03-21 23:35:09.656: W/System.err(333):
at com.google.ads.internal.AdWebView.<init>  (SourceFile:69)
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!