0

是什么原因导致 a NullPointerExceptionon rotateThreadedDelayedwith a AdWhirlLayout

这是堆栈跟踪:

java.lang.NullPointerException
at com.adwhirl.AdWhirlLayout.rotateThreadedDelayed(wHAT .java:237)
at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:210)
at com.adwhirl.AdWhirlLayout.access$3(AdWhirlLayout.java:205)
at com.adwhirl.AdWhirlLayout$HandleAdRunnable.run(AdWhirlLayout.java:390)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

1

我有同样的问题很长一段时间。现在好像没有解决办法,只能下载 Adwhirl SDK for Android 的源代码,自己修复这个 NPE。修复本身非常简单,已经在这里讨论过:http ://groups.google.com/group/adwhirl-users/msg/b9641da44fa0f0ce

这是固定代码:

public void rotateThreadedDelayed() {
    int cycleTime = 30; 
    if( extra != null ) { 
        cycleTime = extra.cycleTime; 
    } 
    Log.d(AdWhirlUtil.ADWHIRL, "Will call rotateAd() in " + cycleTime + " seconds"); 
    scheduler.schedule(new RotateAdRunnable(this), cycleTime, TimeUnit.SECONDS); 
}
于 2011-11-15T15:31:49.527 回答