运行查询游标后,保存这样的数据
1 - R. Robert
1 - F. Ahmed
2 - M. Rahman
2 - T. Banik
3 - L. Morison
我想通过特定的 id Like 1 获取数据,然后将其存储在数组中。我试过这个
String [] Names = null;
cursor.moveToFirst();
do{
if(cursor.getString(cursor.getColumnIndexOrThrow("_id")).equalsIgnoreCase("1")){
String namesAuth = cursor.getString(cursor.getColumnIndexOrThrow("NAME"));
Names[cursor.getInt(cursor.getColumnIndexOrThrow("_id"))] = namesAuth;
}
}while(cursor.moveToNext());
我想要这样的格式 [R.Robert,F.Ahmed]。这可能吗 ?谢谢