05-30 11:43:06.783: E/CursorWindow(376): Can't read row# 0, col# -1 from CursorWindow. Make sure your Cursor is initialized correctly.
05-30 11:43:06.783: D/AndroidRuntime(376): Shutting down VM
05-30 11:43:06.793: W/dalvikvm(376): threadid=1: thread exiting with uncaught exception (group=0x40014760)
05-30 11:43:06.824: E/AndroidRuntime(376): FATAL EXCEPTION: main
05-30 11:43:06.824: E/AndroidRuntime(376): java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it
05-30 11:43:06.824: E/AndroidRuntime(376): at android.database.CursorWindow.getString_native(Native Method)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.database.CursorWindow.getString(CursorWindow.java:372)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:32)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.database.CursorWrapper.getString(CursorWrapper.java:108)
05-30 11:43:06.824: E/AndroidRuntime(376): at com.test.app.ts.call.RecentCallsRightFragment$MySimpleCursorAdapter1.bindView(RecentCallsRightFragment.java:117)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.CursorAdapter.getView(CursorAdapter.java:251)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.AbsListView.obtainView(AbsListView.java:1970)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.ListView.measureHeightOfChildren(ListView.java:1228)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.ListView.onMeasure(ListView.java:1139)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:956)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.onMeasure(LinearLayout.java:521)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureVertical(LinearLayout.java:613)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.onMeasure(LinearLayout.java:519)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureVertical(LinearLayout.java:613)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.onMeasure(LinearLayout.java:519)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:956)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.onMeasure(LinearLayout.java:521)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureVertical(LinearLayout.java:613)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.onMeasure(LinearLayout.java:519)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureVertical(LinearLayout.java:613)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.onMeasure(LinearLayout.java:519)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:956)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.onMeasure(LinearLayout.java:521)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.FrameLayout.onMeasure(FrameLayout.java:267)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.measureVertical(LinearLayout.java:764)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.LinearLayout.onMeasure(LinearLayout.java:519)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.widget.FrameLayout.onMeasure(FrameLayout.java:267)
05-30 11:43:06.824: E/AndroidRuntime(376): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:1890)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.View.measure(View.java:10828)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewRoot.performTraversals(ViewRoot.java:909)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.view.ViewRoot.handleMessage(ViewRoot.java:2003)
05-30 11:43:06.824: E/AndroidRuntime(376): at android.os.Handler.dispatchMessage(Handler.
Answer
See if you have defined the column in projection like this, used to load the Cursor. I missed to add RecentCallsTable.COLUMN_CALL_DURATION into the projection.
static final String[] PROJECTION = new String[] { RecentCallsTable._ID,
RecentCallsTable.COLUMN_CALLER_NAME, RecentCallsTable.COLUMN_CALLER_LOCATION,
RecentCallsTable.COLUMN_CALLER_IP, RecentCallsTable.COLUMN_CALL_TIME, RecentCallsTable.COLUMN_CALL_DURATION, RecentCallsTable.COLUMN_CALL_TYPE,
};
CursorLoader cl = new CursorLoader(getActivity(), RecentCallsTable.CONTENT_URI, PROJECTION,
null, null, null);
No comments:
Post a Comment