我正在尝试将LeadBolt添加到我的游戏中。我已成功整合他们的sdk并在Android项目上接收广告。但遇到libgdx的android端口问题。这是我的MainActivity.java
public class MainActivity extends AndroidApplication implements LeadBoltInterface{
private AdController ad;
String Offer_Wall = "406654115", Alert_Simple = "205987650",
INTERSTITIA = "198781435", ReEngagement = "399870327",
App_Audio = "307311112", APP_AD_ID = "141754365";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.useGL20 = true;
initialize(new RocketMouse(this), cfg);
ad = new AdController(this, APP_AD_ID);
ad.loadAd();
ad.loadStartAd(App_Audio, ReEngagement);
}
@Override
public void showMyFullScreenAd() {
// TODO Auto-generated method stub
// ad.loadAd();
// ad.loadStartAd(App_Audio, ReEngagement);
}
}
我的清单文件也配置得很好。但由于onCreate()
中的以下行,应用程序在启动时崩溃ad.loadAd(); ad.loadStartAd(App_Audio,ReEngagement);
java.lang.runtimeexception:执行doInBackground()时发生错误
..... 03-01 19:05:50.738:E / AndroidRuntime(32400):java.lang.RuntimeException:无法在未调用Looper.prepare()的线程内创建处理程序
我是android新手,但熟悉libgdx。请帮帮我。