File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LoaderManager does not find an existing _id column

 
Hanna Borodina
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hanna Borodina
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic