我有一个listview
. 我使用包含 atextView
和imageview
.
Textview
因为那是从 a 填充的arraylist
。我使用了一个array-adapter
,因为它直接给了我,而我getFilter()
又用它来过滤列表。
我正在运行一个数据库查询,它返回一个项目列表。我将所有项目存储在一个Cursor
. 现在我正在遍历游标并检查数据库中的项目是否包含在数组列表中。
如果有匹配项,我想切换图像。我该怎么做。
Cursor crs = actSl.execSQL(sqlQuery);
if (crs != null && crs.getCount() > 0) {
crs.moveToFirst();
if (crs.getCount() > 0) {
do {
for(String favItem:favouritesList){
if (favItem.contains(crs.getString(0))) {
}
}
} while (crs.moveToNext());
}
}