使用 AdWhirlLayout 时,rotateThreadedDelayed 上出现 NullPointerException

发布于 2024-11-25 00:41:51 字数 972 浏览 1 评论 0原文

是什么导致使用 AdWhirlLayoutrotateThreadedDelayed 出现 NullPointerException

这是堆栈跟踪:

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)

What cause a NullPointerException on rotateThreadedDelayed with an AdWhirlLayout?

Here is the stacktrace :

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟火散人牵绊 2024-12-02 00:41:51

我有同样的问题很长一段时间了。目前似乎没有解决办法,只能下载 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); 
}

I have same problem for quite long time. It seems like there is not solution for now, except download source code of Adwhirl SDK for Android and fix this NPE by yourself.
The fix itself is pretty straightforward and already discussed here: http://groups.google.com/group/adwhirl-users/msg/b9641da44fa0f0ce

Here is fixed code:

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); 
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文