public void onItemClick(AdapterView<?> parent, View v, int position, long l) { TextView tv = (TextView) v; String name = tv.getText().toString(); if (isHost) { if (persistant.contains(name)) { tv.setTextColor(Color.parseColor("#ffffff")); persistant.remove(name); contactList.remove(name); } else { tv.setTextColor(ActivityCreateGame.ParseColor(mListener.passContext(), R.color.trimmings)); persistant.add(name); } } else { PhoneNumber number = contactList.get(name); mListener.startJoinProcess(number); } }
public int parseColor(int id) { return ActivityCreateGame.ParseColor(mListener.passContext(), id); }