Sqlite how to get string items using cursor

前端 未结 5 1856
鱼传尺愫
鱼传尺愫 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 07:11

    And what you should do is to replace

    c1.moveToFirst();
    while(c1.isLast()){
         //your code
    }
    

    By

    //c1.moveToFirst();
    while(c1.moveToNext()){
         //your code
    }
    

提交回复
热议问题