Note that there are some explanatory texts on larger screens.

plurals
  1. POexpandableList problem
    primarykey
    data
    text
    <p>I'm trying to build expandableList with SimpleCursorTreeAdapter but my list does not make groups, it repeats every child element as group element.</p> <p>My datas are formed as KEY_ROWID ,KEY_NAME , KEY_EMAIL ,KEY_ILID ,KEY_KURUMID ,KEY_BOLGEID</p> <hr> <p>my datas:</p> <pre><code>(db,"Asli", "asli@gmail.com", 1, 1, 1); (db,"Osman Can", "osman@gmail.com", 1, 1, 1); (db,"Abuzer Kadayif", "kadayif@gmail.com", 1, 2, 1); (db,"Emre", "emre@gmail.com", 1, 3, 2); (db,"Deniz", "deniz@gmail.com", 1, 4, 2); (db,"Simon Garfunkel", "simon@gmail.com", 1, 5, 0); (db,"Eric Clapton", "eric@gmail.com", 1, 6, 0); (db,"Neil Young", "neil@gmail.com", 1, 5, 0); </code></pre> <hr> <p>And This is my code:</p> <pre><code>String sqlString = "SELECT * " + " FROM " + Items.DATABASE_TABLE; Cursor mCursor = db.rawQuery(sqlString, null); SimpleCursorTreeAdapter mAdapter = new SimpleCursorTreeAdapter(this, mCursor, R.layout.row, R.layout.exprow, //createGroupList(), new String[] { Items.KEY_BOLGEID }, new int[] { R.id.txtItem }, R.layout.exprow, R.layout.exprow, new String[] { Items.KEY_EMAIL,Items.KEY_NAME }, new int[] { R.id.dscItem, R.id.manuItem }) { @Override protected Cursor getChildrenCursor(Cursor groupCursor) { String tempGroup = groupCursor.getString(groupCursor .getColumnIndex(Items.KEY_BOLGEID)); DbHelper dbh = new DbHelper(BrowseActivity.this); SQLiteDatabase db = dbh.getWritableDatabase(); String sqlString = "SELECT " + Items.KEY_ROWID + ", " + Items.KEY_EMAIL + ", " + Items.KEY_NAME + ", " + Items.KEY_KURUMID + ", " + Items.KEY_BOLGEID + ", " + Items.KEY_ILID + " FROM " + Items.DATABASE_TABLE + " WHERE " + Items.KEY_BOLGEID + "= " + tempGroup ; Cursor mCursor = db.rawQuery(sqlString, null); return mCursor; } }; browseView.setAdapter(mAdapter); } </code></pre> <p>My result should be:</p> <pre><code>Group 1: (db,"Asli", "asli@gmail.com", 1, 1, 1); (db,"Osman Can", "osman@gmail.com", 1, 1, 1); (db,"Abuzer Kadayif", "kadayif@gmail.com", 1, 2, 1); Group 2: (db,"Emre", "emre@gmail.com", 1, 3, 2); (db,"Deniz", "deniz@gmail.com", 1, 4, 2); Group 3: (db,"Simon Garfunkel", "simon@gmail.com", 1, 5, 0); (db,"Eric Clapton", "eric@gmail.com", 1, 6, 0); (db,"Neil Young", "neil@gmail.com", 1, 5, 0); </code></pre> <p>But it is 3 times group 1 2 times group 2 3 times group 0</p> <p>And I tried to change sql of groupCursor, but it crashes.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload