当我集成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)

最佳答案

Tapjoy getFeaturedApp()方法正在产生一个新线程,这听起来像您的adMob库应该在主线程上运行。尝试对您的adMob代码使用runOnUiThread在主线程上运行。

关于android - TapJoy插页式广告崩溃,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10226491/

10-11 05:31