How do I change the color of an item or the entire Backgroud of a ListView by onActivityResult?

1

It seems that I can only change the color of an item in onItemClick() and the full Background color when I populate ListView .

Does anyone know how to do this? What I needed was to click on an item from the list of Activity A, open a form on Activity B and after giving finish() on Activity B, change color on List item from Activity The one I just completed the form.

    
asked by anonymous 24.08.2015 / 17:11

2 answers

0

Change list color:

    ListView lV = null;
    lV = getListView();
    lV = (ListView) findViewById(R.id.mylist); // Nome da sua listView
    lV.setBackgroundColor(Color.WHITE); // SUA COR

Change the color of a line in the list:

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    View view = super.getView(position, convertView, parent);
    if (highlightedPositions.contains(position)) {
    view.setBackgroundColor(Color.WHITE); // SUA COR
    }
    return view;
    }
    
24.08.2015 / 22:12
0

I think I answered a question similar to the one you asked.

Follow the link: How to change a ListView item's color based on the response of the" onActivityResult "?

    
25.08.2015 / 17:13