Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error getEntityList() #200

Closed
jefioliveira opened this issue Jul 17, 2015 · 8 comments
Closed

Error getEntityList() #200

jefioliveira opened this issue Jul 17, 2015 · 8 comments

Comments

@jefioliveira
Copy link

Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.

@greenrobot
Copy link
Owner

Can you provide more details like some code, and a stacktrace? Can you narrow the issue down?

@jefioliveira
Copy link
Author

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.database.CursorWindow.nativeGetLong(Native Method)
at android.database.CursorWindow.getLong(CursorWindow.java:507)
at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:75)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219)
at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:236)
at de.greenrobot.dao.AbstractDao.loadAllFromCursor(AbstractDao.java:332)
at de.greenrobot.dao.AbstractDao.loadAllAndCloseCursor(AbstractDao.java:167)
at de.greenrobot.dao.Query.list(Query.java:93)
at com.comp.test.entity.AnexoDao._queryOcorrencia_AnexoList(AnexoDao.java:193)
at com.comp.test.entity.Ocorrencia.getAnexoList(Ocorrencia.java:727)
at com.comp.test.asynctask.TabPhotoHistoryAsyncTask.doInBackground(TabPhotoHistoryAsyncTask.java:152)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
... 5 more
java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.database.CursorWindow.nativeGetLong(Native Method)
at android.database.CursorWindow.getLong(CursorWindow.java:507)
at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:75)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219)
at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:236)
at de.greenrobot.dao.AbstractDao.loadAllFromCursor(AbstractDao.java:332)
at de.greenrobot.dao.AbstractDao.loadAllAndCloseCursor(AbstractDao.java:167)
at de.greenrobot.dao.Query.list(Query.java:93)
at com.comp.test.entity.AnexoDao._queryOcorrencia_AnexoList(AnexoDao.java:193)
at com.comp.test.entity.Ocorrencia.getAnexoList(Ocorrencia.java:727)
at com.comp.test.asynctask.TabPhotoHistoryAsyncTask.doInBackground(TabPhotoHistoryAsyncTask.java:152)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)

@nAkhmedov
Copy link

nAkhmedov commented Jun 27, 2016

I have faced this issue too :((( @jefioliveira Did you fix?

@nAkhmedov
Copy link

java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.database.CursorWindow.nativeGetLong(Native Method)
at android.database.CursorWindow.getLong(CursorWindow.java:511)
at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:75)
at de.greenrobot.dao.AbstractDao.loadCurrent(AbstractDao.java:412)
at de.greenrobot.dao.InternalQueryDaoAccess.loadCurrent(InternalQueryDaoAccess.java:17)
at de.greenrobot.dao.query.LazyList.loadEntity(LazyList.java:259)
at de.greenrobot.dao.query.LazyList.get(LazyList.java:239)
at com.shazzle.homebridge.adapter.EmailListAdapter.getItemId(EmailListAdapter.java:89)
at android.widget.AdapterView.rememberSyncState(AdapterView.java:1226)
at android.widget.AdapterView$AdapterDataSetObserver.onChanged(AdapterView.java:820)
at android.widget.AbsListView$AdapterDataSetObserver.onChanged(AbsListView.java:6140)
at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
at com.shazzle.homebridge.fragment.MailboxFragment.onLoadFinished(MailboxFragment.java:302)
at com.shazzle.homebridge.fragment.MailboxFragment.onLoadFinished(MailboxFragment.java:64)
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.callOnLoadFinished(LoaderManager.java:476)
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManager.java:444)
at android.support.v4.content.Loader.deliverResult(Loader.java:126)
at com.shazzle.homebridge.loader.EmailLoader.deliverResult(EmailLoader.java:79)
at com.shazzle.homebridge.loader.EmailLoader.deliverResult(EmailLoader.java:14)
at android.support.v4.content.AsyncTaskLoader.dispatchOnLoadComplete(AsyncTaskLoader.java:249)
at android.support.v4.content.AsyncTaskLoader$LoadTask.onPostExecute(AsyncTaskLoader.java:77)
at android.support.v4.content.ModernAsyncTask.finish(ModernAsyncTask.java:466)
at android.support.v4.content.ModernAsyncTask.access$400(ModernAsyncTask.java:48)
at android.support.v4.content.ModernAsyncTask$InternalHandler.handleMessage(ModernAsyncTask.java:483)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

@jefioliveira
Copy link
Author

jefioliveira commented Jun 28, 2016

I solved @nAkhmedov . In my case , I changed my gridview and greendao jar update was 1.6 to 2.0 and now my gridviewAdapter not change or update dao instantly .

My scenario ,

I have into this one fragment viewpager with twelve fragments .

On that fragment I have a gridView . In gridview you can change any elements , in
each of these you have nine elements included one photo (ALL DATA YOU HAVE A CHANGE ), apply changes after I update data include photo . That process causes this issues throw . But I have change my fragment and solve .

@jefioliveira
Copy link
Author

Sorry for my long time to response!�

@nAkhmedov
Copy link

@jefioliveira Thank you for description

@greenrobot-team
Copy link
Collaborator

Outdated. Closing. Please open a new issue if this is still relevant. -ut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants