qq_38034939
qq_38034939
采纳率46.2%
2017-08-02 15:26

android 大神 帮忙看一下!

已采纳

08-02 23:22:12.044 25124-25153/com.example.lenovo.push E/AndroidRuntime: FATAL EXCEPTION: ModernAsyncTask #1
Process: com.example.lenovo.push, PID: 25124
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.support.v4.content.ModernAsyncTask$3.done(ModernAsyncTask.java:161)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
Caused by: android.database.sqlite.SQLiteException: no such column: date_addedDESC (code 1): , while compiling: SELECT _id, _data, date_added FROM images ORDER BY date_addedDESC
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: date_addedDESC (code 1): , while compiling: SELECT _id, _data, date_added FROM images ORDER BY date_addedDESC)
#################################################################
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:179)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:536)
at android.support.v4.content.ContentResolverCompatJellybean.query(ContentResolverCompatJellybean.java:33)
at android.support.v4.content.ContentResolverCompat$ContentResolverCompatImplJB.query(ContentResolverCompat.java:57)
at android.support.v4.content.ContentResolverCompat.query(ContentResolverCompat.java:125)
at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:59)
at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:37)
at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:302)
at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:57)
at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:45)
at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:138)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 3 more

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • chenbaige legendCoder 4年前

    你执行的sql语句是:SELECT _id, _data, date_added FROM images ORDER BY date_addedDESC

    而提示的错误是找不到date_addedDESC这一列,明显排序的时候少了空格嘛。应该是date_added DESC,修改一下就好了

    点赞 2 评论 复制链接分享

为你推荐