Sqlite how to get string items using cursor

前端 未结 5 1842
鱼传尺愫
鱼传尺愫 2020-12-18 06:38
public Cursor getImages(long rowId) throws SQLException
    {
        Cursor mCursor =
                db.rawQuery(\"select * from Pictures WHERE id=\" + rowId + \";         


        
5条回答
  •  温柔的废话
    2020-12-18 06:52

    simply use moveToNext in your loop to iterate.

    while(ct.moveToNext()){
         pictures[i]=c1.getString(1);
         comments[i]=c1.getString(2);
         i++;
    }
    

提交回复
热议问题