当我整合了TapJoy非页内广告时,它运行正常。但现在,我有一个机制,如果Tapjoy未能提供广告,我会转向其他广告网络,如adMob,Mobclix等。 问题是,除了Tapjoy之外,滚动机制与所有广告网络都运行良好。 在Tapjoy的情况下,每当它失败并且正在向admob,mobclix或Inmobi发生翻转时,应用程序就会崩溃。 崩溃日志:
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.<init>(Handler.java:121)
at com.mobclix.android.sdk.MobclixFullScreenAdView$AdResponseHandler.<init>(MobclixFullScreenAdView.java:392)
at com.mobclix.android.sdk.MobclixFullScreenAdView$AdResponseHandler.<init>(MobclixFullScreenAdView.java:392)
at com.mobclix.android.sdk.MobclixFullScreenAdView.<init>(MobclixFullScreenAdView.java:104)
at com.apostek.library.AdLibrary.loadInterstial(AdLibrary.java:1091)
at com.apostek.library.AdLibrary.rollOverInterstial(AdLibrary.java:1450)
at com.apostek.library.AdLibrary.access$0(AdLibrary.java:1447)
at com.apostek.library.AdLibrary$9.getFeaturedAppResponseFailed(AdLibrary.java:1408)
at com.tapjoy.TapjoyFeaturedApp$1.run(TapjoyFeaturedApp.java:98)
at java.lang.Thread.run(Thread.java:1096)
答案 0 :(得分:2)
Tapjoy getFeaturedApp()
方法正在产生一个新线程,听起来您的adMob库应该在主线程上运行。尝试使用runOnUiThread让您的adMob代码在主线程上运行。