I`m currently trying to write my first ever Android application, and I`ve got an exception I have no idea how to fight. I`ve already got errors that were fixed by restarting the eclipse, but this isn`t one of them, since this method didn`t work.
Here`s a log trace:
(no, the "..." is not really there. I just use it as a marker to show that there are other things there that I considered irrelevant to the problem)
I`ve already seen this exception in this project, and I fixed the problem by renaming the primary field to "_id" as is required. The method where I got the exception the first time works correctly now. It was similar only working with another table. I checked through SQLite Database Manager - yes, all the tables have "_id" as id.
Here`s the code where the cursor loader is defined:
Here are the constants referenced there:
(Errr. The code tag seems to have turned a "_" into a space before "id". Here`s a copypaste of that line outside the tag: public static final String COLUMN_NAME_ID = "_id";)
Here`s the code of creating a table in my implementation of SQLiteOpenHelper:
I am using a support library, so I had to make the class ListFragment, although there is no need to use fragments.
I have a similar class on the previous page, and there it works correctly. Does anyone here have any idea what`s wrong?
Thanks in advance.
posted 7 years ago
I did sort of find the way around that bug. Here`s the working code:
I just added that _id column to the list of the columns getting pulled. But this is still weird.
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled