Strange behavior of inflated buttons when changing one's color
问题 I am trying to implement a dynamic button inflation for my Android application, based on an input specified by the user in real time. When clicked, button changes its color from blue to red. The code responsible for this goes as follows: LayoutInflater layoutsInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); LinearLayout linearLayout = (LinearLayout) findViewById(R.id.layout_for_buttons); // Let's say that now we need only 3 buttons: for (int i = 0; i < 3; i++) {