0

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)
Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
dirhem
  • 611
  • 1
  • 12
  • 24

1 Answers1

1

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); 
}
HitOdessit
  • 7,198
  • 4
  • 36
  • 59