我正在使用可扩展的列表视图。当我单击父级时,它会正确显示子级信息。但是,当我在我的孩子仍然崩溃的情况下向下滚动时,我收到一个错误 - 对字段插槽 0,-1 numrows=3 numcolumns=3 的错误请求。当我向上滚动时,没有问题。或者如果我的孩子没有折叠,那么在任何地方滚动都没有问题。
我的simplecursorttree适配器代码:-
Cursor cursor = db.rawQuery("SELECT _id,words from keywords", null);
startManagingCursor(cursor);
SimpleCursorTreeAdapter mAdapter = new SimpleCursorTreeAdapter(TestActivity.this,
cursor, R.layout.exprow,
new String[] { DbHandler.D_WORDS}, new int[] { R.id.textText},
R.layout.row,new String[] {DbHandler.C_STATUS,DbHandler.C_CREATED_AT,DbHandler.C_USER}, new int[] {R.id.textStatus,R.id.textCreatedAt,R.id.textUser}) {
@Override
protected Cursor getChildrenCursor(Cursor groupCursor) {
dbhandler=new DbHandler(TestActivity.this);
SQLiteDatabase db = dbhandler.getReadableDatabase();
String get=groupCursor.getString(1);
Log.d("Post Operation", "Getting cursor for keyword = " +get);
String sql="SELECT status,created_at,user from tweets where words='"+get+"'" ;
Cursor cursor = db.rawQuery(sql, null);
startManagingCursor(cursor);
Log.d("TestActivity","Cursor got count"+cursor.getCount());
db.close();
return cursor;
}
};