This morning, a menu was created using the gridview for switching between the two interfaces. However, the same background color was set, which made it impossible to identify the current interface. After dinner, I began to read materials online to solve this problem. After reading many posts, my predecessors summarized a variety of methods, but most of them were complicated. Some of them only extracted some of the Code, you can't understand it directly. Finally, I was taken care of it and saw a reply from a great god to solve the problem:
Set the listselector attribute in the gridview layout, that is, Android: listselector = "# ff0000". Here I set it to red, that is, when a row (Row A) is pressed, the background color is changed to Red. When other rows are clicked, the row (Row A) restores the original color. You can complete this simple attribute setting. In an instant, I decided to go to bed tonight.
The color of the row is changed after the gridview is clicked.