J'essaye de peindre quelques lignes simples dans une liste, mais je ne sais pas comment faire. Je sais seulement comment changer l'arrière-plan de toute la liste. Mon code actuel est le suivant:Peinture à une rangée dans ListView
public void paintBackgroundRed(ArrayList<Integer> profileIngList, ArrayList<Integer> productIngList){
ListView lv = (ListView) findViewById(R.id.list_ingredients);
for(int profileIng: profileIngList)
{
if (productIngList.contains(profileIng)){
// paint int profileIng red
}
}
}
J'ai un hashmap pour mapper la ligne à l'ID d'ingrédient de profil. Comment puis-je peindre la ligne commentée? Merci.