2

When I had integrated TapJoy Interstitial ad it was working fine. But now, I have a mechanism that if Tapjoy fails to gives ad, I rollover to some other ad network like adMob, Mobclix, etc. The problem is that the rolling over mechanism is working fine with all the ad networks, except Tapjoy. In the case of Tapjoy, whenever it is getting failed and rollover is happening to admob, mobclix or Inmobi, the app is crashing. Crash Logs:

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)
4

1 回答 1

2

The Tapjoy getFeaturedApp() method is spawning a new thread and it sounds like your adMob library is expected to run on the main thread. Try using runOnUiThread for your adMob code to run on the main thread.

于 2012-04-19T19:04:28.560 回答