0

Here I hace set color of row for value in ListView. Now i want set only color this string, no all row

ListAdapter adapter = new SimpleAdapter(MainActivity.this, DevicesList,
                    R.layout.list_item, new String[]{"name", "clients", "stan"},
                    new int[]{R.id.name, R.id.clients, enabled}){
                @Override
                public View getView(int position, View convertView, ViewGroup parent) {
                    View view = super.getView(position, convertView, parent);
                    TextView v = (TextView) view.findViewById(R.id.enabled);
                    String a = v.getText().toString();

                    if (a == "Aktywny") {
                        view.setBackgroundColor(Color.argb(125,53,104,45));
                    } else if(a == "Nieaktywny") {
                        view.setBackgroundColor(Color.argb(125,175,43,30));
                    } else{
                        view.setBackgroundColor(Color.argb(125,139,140,122));
                    }

                    return view;
                }
            };
Torwopik
  • 19
  • 5

1 Answers1

0
v.setTextColor(Color.argb(125,175,43,30))
Matias Elorriaga
  • 8,880
  • 5
  • 40
  • 58