Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid app crashes with NullPointerException in ChoreoGrapher
    text
    copied!<p>I have the following code, trying to create a simple ListAdapter in a ListView (I had this code working before and this is the only place I have changed something):</p> <pre><code>public BuddyListAdapter(Context context, HashMap&lt;String, Buddy&gt; hashMap) { buddyList = new ArrayList&lt;Buddy&gt;(hashMap.values()); mInflater = LayoutInflater.from(context); ctx = context; } </code></pre> <p>When stepping through, nothing happens, but when running, I get a <code>NullPointerException</code> in <code>ChoreoGrapher.doCallbacks</code>, when I create an empty <code>ArrayList</code>, it doesn't crash:</p> <pre><code>public BuddyListAdapter(Context context, HashMap&lt;String, Buddy&gt; hashMap) { buddyList = new ArrayList&lt;Buddy&gt;(); mInflater = LayoutInflater.from(context); ctx = context; } </code></pre> <p>What is the <code>ChoreoGrapher</code> and why is it crashing my app?</p> <p>I am completely stuck on what could be the problem, or how to figure out what is wrong. The Eclipse debugger or crash information is not really helping.</p> <p>The entire stack trace is as follows:</p> <pre><code>Thread [&lt;1&gt; main] (Suspended (exception NullPointerException)) Choreographer.doCallbacks(int, long) line: 558 Choreographer.doFrame(long, int) line: 525 Choreographer$FrameDisplayEventReceiver.run() line: 711 Handler.handleCallback(Message) line: 615 Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 92 Looper.loop() line: 137 ActivityThread.main(String[]) line: 4745 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 511 ZygoteInit$MethodAndArgsCaller.run() line: 786 ZygoteInit.main(String[]) line: 553 NativeStart.main(String[]) line: not available [native method] </code></pre> <p>I also have a <code>Handler</code> in the main activity. When it is not doing anything, the listview doesn't crash. However, I remove all callbacks from it before openning the listview.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload