There are some problem that I cannot solve by myself. I'm currently making a simple android app for my training that utilizes multiple checkbox's.
What I want to do is as the title says, change the color of the text of the checkbox when the the condition is setEnabled(true). I've searched through google but couldn't find the solution to it. I've added the sample code that I'm using below. Sonce, I'm a noob the help from the pro's means a lot to me.
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { buttonView.setTextColor(Color.GREEN); buttonClicked.add(buttonView.getText() .toString()); buttonView.setTextSize(18); count += 1; Log.d("TAG","is checked = "+isChecked); if (count >= 7) { for (int i = 0; i < checkbox.length; i++) { String item = Integer.toString(i+1); if (buttonClicked.indexOf(item)>-1) { checkbox[i].setEnabled(true); Log.d("TAG",i+" = 2is checked = "+isChecked); // buttonView.setTextColor(Color.YELLOW); } else { Log.d("TAG",i+" = 3is checked = "+isChecked); checkbox[i].setEnabled(false); // buttonView.setTextColor(Color.RED); } } } } else { if (count <= 7) { for (int i = 0; i < checkbox.length; i++) { checkbox[i].setEnabled(true); // buttonView.setTextColor(Color.BLACK); } } count--; buttonClicked.remove(buttonView.getText() .toString()); buttonView.setTextSize(15); }
setChecked(boolean value)? Your question is not clear, Can you make it more clear, it will be very helpful for us to help you :)