Sorry if this seems silly, I just cannot understand this runtime error I’m getting. For reference, here is my code:
MainListViewRecordAdapter.java
Currently, I’m getting a NullPointerException on line 27 of the MainListViewRecordAdapter. When I run the debugger, the int position has always been 0, which leads the code to not grad an item out of the ArrayList, causing the NullPointerException. The only thing is, I don’t understand why that’s happening, why is position always having the value 0?
you havent initialized Arraylist items and remove line position=1;. do as follows: