I am getting the following error on my Android App. Up until about 20 minutes ago it was working fine.
[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: SaintSource.SaintSource, PID: 5497
[AndroidRuntime] java.lang.NullPointerException
[AndroidRuntime] at android.widget.AbsListView.obtainView(AbsListView.java:2265)
[AndroidRuntime] at android.widget.ListView.makeAndAddView(ListView.java:1790)
[AndroidRuntime] at android.widget.ListView.fillDown(ListView.java:691)
[AndroidRuntime] at android.widget.ListView.fillFromTop(ListView.java:752)
[AndroidRuntime] at android.widget.ListView.layoutChildren(ListView.java:1630)
[AndroidRuntime] at android.widget.AbsListView.onLayout(AbsListView.java:2091)
[AndroidRuntime] at android.view.View.layout(View.java:14785)
[AndroidRuntime] at android.view.ViewGroup.layout(ViewGroup.java:4631)
[AndroidRuntime] at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
[AndroidRuntime] at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
[AndroidRuntime] at android.view.View.layout(View.java:14785)
[AndroidRuntime] at android.view.ViewGroup.layout(ViewGroup.java:4631)
[AndroidRuntime] at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
[AndroidRuntime] at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
[AndroidRuntime] at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
[AndroidRuntime] at android.view.View.layout(View.java:14785)
[AndroidRuntime] at android.view.ViewGroup.layout(ViewGroup.java:4631)
[AndroidRuntime] at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
[AndroidRuntime] at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
[AndroidRuntime] at android.view.View.layout(View.java:14785)
[AndroidRuntime] at android.view.ViewGroup.layout(ViewGroup.java:4631)
[AndroidRuntime] at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1985)
[AndroidRuntime] at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1742)
[AndroidRuntime] at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
[AndroidRuntime] at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5582)
[AndroidRuntime] at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
[AndroidRuntime] at android.view.Choreographer.doCallbacks(Choreographer.java:562)
[AndroidRuntime] at android.view.Choreographer.doFrame(Choreographer.java:532)
[AndroidRuntime] at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
[AndroidRuntime] at android.os.Handler.handleCallback(Handler.java:733)
[AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:95)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:137)
[AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:4998)
[AndroidRuntime] at java.lang.reflect.Method.invokeNative(Native Method)
[AndroidRuntime] at java.lang.reflect.Method.invoke(Method.java:515)
[AndroidRuntime] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
[AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
[AndroidRuntime] at dalvik.system.NativeStart.main(Native Method)
[Process] Sending signal. PID: 5497 SIG: 9
In my GetView override method I have the following:
if (view == null) {
view = context.LayoutInflater.Inflate (Resource.Layout.saint_row, parent, false);
}
and obviously the view is an adapter.
I did change the above line from this:
if (view == null) {
view = context.LayoutInflater.Inflate (Resource.Layout.saint_row, null);
}
It worked for about 30 seconds then started throwing the exception again.