Hi,

I occasionally get exceptions like this one here:

android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a
size of 0
at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)
at
android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:172)
at
android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:99)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:194)
at android.widget.CursorAdapter.getView(CursorAdapter.java:177)
at android.widget.AbsListView.obtainView(AbsListView.java:1254)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1142)
at android.widget.ListView.onMeasure(ListView.java:1055)
at android.view.View.measure(View.java:7117)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2929)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
at android.view.View.measure(View.java:7117)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2929)
at
android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)
at android.view.View.measure(View.java:7117)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2929)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
at android.view.View.measure(View.java:7117)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)
at android.view.View.measure(View.java:7117)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2929)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
at android.view.View.measure(View.java:7117)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2929)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
at android.view.View.measure(View.java:7117)
at android.view.ViewRoot.performTraversals(ViewRoot.java:866)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1718)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3948)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
at dalvik.system.NativeStart.main(Native Method)

My own code isn't really touched in this stack trace and I am wondering what
I might be doing wrong here?

I suspect it is something about the coordination of redraw/invalidation
events, but I don't know where to look exactly.

When I update the model (the sqlitedatabase) I run the following code on the
UI thread afterwards:

  void refreshUI() {

        ((BaseAdapter) getListAdapter()).notifyDataSetChanged();

        // the remaining calls are just included for completeness

        // they update different ui elements, but don't access the cursor in
any way.

        updateButtons();

        updateControlPanelTitle();

        updateProgressBar();

    }


Any other information I can provide?

Cheers,

Mariano

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

Reply via email to