[android-developers] Re: Why this Exception is coming ?

2010-06-30 Thread Al Sutton
When using a SimpleCursorAdapter one of the columns returned by the
query used to create the cursor should be called _id and is used as
the id value for the row.

SimpleCursorAdapter is a descendant of CursorAdapter which states the
requirement for the _id column (see
http://developer.android.com/reference/android/widget/CursorAdapter.html)

Al.

On Jun 29, 7:53 am, dinesh_adwani mail.dineshadw...@gmail.com wrote:
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215): Caused by:
 java.lang.IllegalArgumentException: column '_id' does not exist
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:
 314)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.CursorAdapter.init(CursorAdapter.java:111)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.CursorAdapter.init(CursorAdapter.java:90)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.ResourceCursorAdapter.init(ResourceCursorAdapter.java:
 47)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.SimpleCursorAdapter.init(SimpleCursorAdapter.java:88)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 com.sasken.epub.bookmark.ShowBookmarkCursorAdapter.init(ShowBookmarkCurso 
 rAdapter.java:
 24)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 com.sasken.epub.bookmark.ShowBookMarkActivity.onStart(ShowBookMarkActivity. 
 java:
 51)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.Instrumentation.callActivityOnStart(Instrumentation.java:
 1129)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.Activity.performStart(Activity.java:3723)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2453)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     ... 11 more

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Why this Exception is coming ?

2010-06-29 Thread Kumar Bibek
Simple
java.lang.IllegalArgumentException: column '_id' does not exist

Thanks and Regards,
Kumar Bibek
http://tech-droid.blogspot.com

On Jun 29, 11:53 am, dinesh_adwani mail.dineshadw...@gmail.com
wrote:
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215): Caused by:
 java.lang.IllegalArgumentException: column '_id' does not exist
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:
 314)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.CursorAdapter.init(CursorAdapter.java:111)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.CursorAdapter.init(CursorAdapter.java:90)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.ResourceCursorAdapter.init(ResourceCursorAdapter.java:
 47)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.SimpleCursorAdapter.init(SimpleCursorAdapter.java:88)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 com.sasken.epub.bookmark.ShowBookmarkCursorAdapter.init(ShowBookmarkCursorAdapter.java:
 24)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 com.sasken.epub.bookmark.ShowBookMarkActivity.onStart(ShowBookMarkActivity.java:
 51)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.Instrumentation.callActivityOnStart(Instrumentation.java:
 1129)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.Activity.performStart(Activity.java:3723)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2453)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     ... 11 more

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Why this Exception is coming ?

2010-06-29 Thread GJTorikian
The database URI you're trying to access doesn't have an _id column.

On Jun 28, 11:53 pm, dinesh_adwani mail.dineshadw...@gmail.com
wrote:
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215): Caused by:
 java.lang.IllegalArgumentException: column '_id' does not exist
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:
 314)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.CursorAdapter.init(CursorAdapter.java:111)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.CursorAdapter.init(CursorAdapter.java:90)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.ResourceCursorAdapter.init(ResourceCursorAdapter.java:
 47)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.widget.SimpleCursorAdapter.init(SimpleCursorAdapter.java:88)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 com.sasken.epub.bookmark.ShowBookmarkCursorAdapter.init(ShowBookmarkCurso 
 rAdapter.java:
 24)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 com.sasken.epub.bookmark.ShowBookMarkActivity.onStart(ShowBookMarkActivity. 
 java:
 51)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.Instrumentation.callActivityOnStart(Instrumentation.java:
 1129)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.Activity.performStart(Activity.java:3723)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2453)
 06-29 11:38:25.544: ERROR/AndroidRuntime(26215):     ... 11 more

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en