我使用的可擴展列表視圖。當我點擊父母時,它會正確顯示孩子信息。但是,當我向下滾動時,我的孩子仍然處於摺疊狀態,我得到一個錯誤 - 請求字段0,-1 numrows = 3 numcolumns = 3。當我向上滾動時,沒有問題。或者如果我的孩子沒有崩潰,那麼在任何地方滾動都沒有問題。滾動已發行的可擴展列表視圖
我對simplecursortree適配器代碼: -
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;
}
};