after my last Problem disappeared after I added the quattro sdk my
classpath, I have now another problem. Sometimes when create the
AdWhirlLayout object I get the following exception:
java.lang.NullPointerException at
com.qwapi.adclient.android.service.AdRequestThread
$1.handleMessage(Unknown Source) at
android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:123) at
com.qwapi.adclient.android.service.AdRequestThread.run(Unknown
Source)
This exception is rather rare but I experienced it myself although I
can't reproduced it. Can anybody help me?
I am also seeing another crashes
java.lang.OutOfMemoryError: thread creation failed
at java.lang.VMThread.create(Native Method)
at java.lang.Thread.start(Thread.java:1327)
at com.adwhirl.AdWhirlLayout.rotateThreadedDelayed(AdWhirlLayout.java:
183)
at com.adwhirl.adapters.GenericAdapter.handle(GenericAdapter.java:43)
at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:156)
at com.adwhirl.AdWhirlLayout.access$0(AdWhirlLayout.java:143)
at com.adwhirl.AdWhirlLayout$1.run(AdWhirlLayout.java:87)
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:4338)
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:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
java.lang.OutOfMemoryError
at
org.apache.http.impl.io.AbstractSessionInputBuffer.init(AbstractSessionInputBuffer.java:
79)
at
org.apache.http.impl.io.SocketInputBuffer.<init>(SocketInputBuffer.java:
93)
at
org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:
83)
at
org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:
170)
at
org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:
106)
at
org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:
129)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
136)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
164)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:
119)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
348)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
555)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
487)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
465)
at com.adwhirl.AdWhirlLayout$7.run(AdWhirlLayout.java:222)
Obviously the out of memory could just be a bug in my program(but it
was not happening before the adwhirl integration) but it is also
possible that occasionally adwhirl isn't cleaning things up properly.
It is really easy to keep references around when they shouldn't be
with things like inner classes and Contexts (my apps do support
rotation so the same activity can get launched a lot of times).
Something to keep your eye on.
I will you guys know if I hear or discover anything else
You can take a look at the changesets to see the difference:
http://code.google.com/p/adwhirl/source/detail?r=25246ccee171344ab8b1d85f42a14e829b59d592&repo=sdk
http://code.google.com/p/adwhirl/source/detail?r=6a34f8ccafc3f226b7470c5925f438f6daec5bb2&repo=sdk
`Justin