Hi, I am using ExpandableListView with AsyncQueryHandler as indicated in the Google samples for Android. But I get some kind of exception saying that this should only be called with the right course
E/AndroidRuntime(28265): FATAL EXCEPTION: main
E/AndroidRuntime(28265): java.lang.IllegalStateException: this should only be called when the cursor is valid
E/AndroidRuntime(28265): at android.widget.CursorTreeAdapter.getGroupView(CursorTreeAdapter.java:198) E/AndroidRuntime(28265): at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:446)
E/AndroidRuntime(28265): at android.widget.AbsListView.obtainView(AbsListView.java:2290)
E/AndroidRuntime(28265): at android.widget.ListView.makeAndAddView(ListView.java:1769)
E/AndroidRuntime(28265): at android.widget.ListView.fillDown(ListView.java:672)
E/AndroidRuntime(28265): at android.widget.ListView.fillSpecific(ListView.java:1330)
E/AndroidRuntime(28265): at android.widget.ListView.layoutChildren(ListView.java:1600)
/AndroidRuntime(28265): at android.widget.AbsListView.onLayout(AbsListView.java:2141)
E/AndroidRuntime(28265): at android.view.View.layout(View.java:13844)
E/AndroidRuntime(28265): at android.view.ViewGroup.layout(ViewGroup.java:4364)
E/AndroidRuntime(28265): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1003)
E/AndroidRuntime(28265): at android.view.View.layout(View.java:13844)
I really cannot find a solution or hack this problem.
I am also trying to request db inside adapters like
@Override
protected void bindChildView(View view, Context context, Cursor cursor,
boolean isLastChild) {
super.bindChildView(view, context, cursor, isLastChild);
TextView txtListChild = (TextView) view
.findViewById(R.id.lblListItem);
txtListChild.setTag(""+cursor.getString(cursor.getColumnIndex(CategorySub.Columns.KEY)));
}
and
@Override
protected void bindGroupView(View view, Context context, Cursor cursor,
boolean isExpanded) {
super.bindGroupView(view, context, cursor, isExpanded);
}
Does this make a problem?
source
share