I am trying to restore the background color of a view.
I have several selected views. When the user clicks on one of these views, the following code is executed and the view turns yellow:
View newSelection, previousSelection; ... if(previousSelection != null) { previousSelection.setBackgroundColor(Color.BLACK);
However, I want to reset the color of the previously selected view. However, I do not know what color it was (I set it to Color.BLACK in the code above). I could not find getBackgroundColor or a similar method in the View class. If I had this, I could save the previous color and just return it when a new view is selected.
source share