0

I am having problems locating the nullpointerexeption that keeps coming up. The log cat does not show a "caused by" tag and that is what is making it difficult to find out what the actual problem is. If anyone could just guide me to finding out what the problem is then that would be great. I have also tried running the debugger and I get the provided error, but I have no clue what to do about it. Below is the error messages that I keep getting, and if need be I will post the code.

Debugger:

Thread [<1> main] (Suspended (exception NullPointerException))  
<VM does not provide monitor information>   
Choreographer.doCallbacks(int, long) line: 565  
Choreographer.doFrame(long, int) line: 532  
Choreographer$FrameDisplayEventReceiver.run() line: 735 
Handler.handleCallback(Message) line: 725   
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 92   
Looper.loop() line: 137 
ActivityThread.main(String[]) line: 5329    
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
Method.invoke(Object, Object...) line: 511  
ZygoteInit$MethodAndArgsCaller.run() line: 1102 
ZygoteInit.main(String[]) line: 869 
NativeStart.main(String[]) line: not available [native method]  

Log Cat Error:

10-09 13:14:35.675: D/dalvikvm(12528): GC_CONCURRENT freed 825K, 9% free 35986K/39424K, paused 3ms+6ms, total 26ms
10-09 13:14:35.675: D/dalvikvm(12528): WAIT_FOR_CONCURRENT_GC blocked 2ms
10-09 13:14:35.705: I/endeffect(12528): AbsListView.onMeasure(), getWidth()=1080, getHeight()=1806, this=android.widget.ExpandableListView{43a168c0 VFED.VC. .F....ID 0,0-1080,1806 #7f060023 app:id/exp_list_view_deals_events}
10-09 13:14:35.705: D/AndroidRuntime(12528): Shutting down VM
10-09 13:14:35.705: W/dalvikvm(12528): threadid=1: thread exiting with uncaught exception (group=0x41467ac8)
10-09 13:14:35.716: E/AndroidRuntime(12528): FATAL EXCEPTION: main
10-09 13:14:35.716: E/AndroidRuntime(12528): java.lang.NullPointerException
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.AbsListView.obtainView(AbsListView.java:2615)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.ListView.measureHeightOfChildren(ListView.java:1253)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.ListView.onMeasure(ListView.java:1165)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:681)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2414)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2133)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1286)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1497)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1183)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4863)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.Choreographer.doCallbacks(Choreographer.java:562)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.Choreographer.doFrame(Choreographer.java:532)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.os.Handler.handleCallback(Handler.java:725)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.os.Handler.dispatchMessage(Handler.java:92)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.os.Looper.loop(Looper.java:137)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at android.app.ActivityThread.main(ActivityThread.java:5329)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at java.lang.reflect.Method.invokeNative(Native Method)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at java.lang.reflect.Method.invoke(Method.java:511)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
10-09 13:14:35.716: E/AndroidRuntime(12528):    at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

1

您在getView()函数中返回 null 。

请参阅此处: ListView 中的崩溃在 AbsListView.obtainView for ListActivity

于 2013-10-09T20:29:36.547 回答