List<ContactInfo> list = new ArrayList<ContactInfo>();//ContactInfo实体类
SQLiteDatabase db = dbOpentHlpergetReadableDatabase();
String sql = "select from contactinfo";
Cursor cursor = dbrawQuery(sql, null);
while (cursormoveToNext()) {
int id = cursorgetInt(cursorgetColumnIndex("_id"));
String name = cursorgetString(cursorgetColumnIndex("name"));
String qq = cursorgetString(cursorgetColumnIndex("qq"));
String msn = cursorgetString(cursorgetColumnIndex("msn"));
String phone = cursorgetString(cursorgetColumnIndex("phone"));
listadd(new ContactInfo(id, name, qq, msn, phone));
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)