我有下面的代码,它会将数据库的结果填充到listview。 我在数据库中有相似名称的数据 现在我的问题是我想在列表视图中只显示一个相似的名字。 我应该如何在下面的代码中实现它?
String query = "SELECT _id, name, symptoms1, symptoms2 FROM hsdisease WHERE symptoms2 LIKE?";
// Append as many WHERE clauses as necessary
for(int x= 0; x<HerbalSuggesstionsArray.length - 1; x++) {
query += " OR symptoms2 LIKE ?";
}
cursor = db.rawQuery(query, HerbalSuggesstionsArray);
adapter = new SimpleCursorAdapter(
this,
R.layout.herbalsuggestion_list_item,
cursor,
new String[] {"name", "symptoms1" },
new int[] {R.id.hsname, R.id.hssymptoms} );
setListAdapter(adapter);