Geeker
V2EX  ›  问与答

Android开发中谁用过SimpleCursorTreeAdapter?求指教啊!我是实在GOOGLE不到才来这问的

  •  
  •   Geeker · Sep 28, 2013 · 2948 views
    This topic created in 4635 days ago, the information mentioned may be changed or developed.
    哪位大神用过呢?
    要重写getChildrenCursor()怎么也写不对。。。


    @Override
    protected Cursor getChildrenCursor(Cursor groupCursor) {
    mGroupIdColumnIndex = groupCursor.getColumnIndexOrThrow(RecordStorage.KEY_ID);
    String groupId = groupCursor.getLong(mGroupIdColumnIndex) + "";

    return rLocalUtils.getChildCursorByID(groupId);
    }



    public Cursor getChildCursorByID(String id) {
    db = mSQLHelper.getReadableDatabase();
    String selection = KEY_ID + " =? AND " + KEY_DELETED + " =? AND " + KEY_HIDDEN + " =? ";
    String[] selectionArgs = { id, "0", "0" };
    Cursor cursor;
    cursor = db.query(RECORDS_TABLE_NAME, new String[] {KEY_DATE, KEY_TAGS, KEY_NOTE}, selection, selectionArgs,
    null, null, KEY_DATE + " DESC");
    return cursor;
    }
    2 replies    1970-01-01 08:00:00 +08:00
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   939 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 22:47 · PVG 06:47 · LAX 15:47 · JFK 18:47
    ♥ Do have faith in what you're doing.