Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

android studio change button color programmatically

// If you're in an activity:
Button11.setBackgroundColor(getResources().getColor(R.color.red));
// OR, if you're not: 
Button11.setBackgroundColor(Button11.getContext().getResources().getColor(R.color.red));
 
PREVIOUS NEXT
Tagged: #android #studio #change #button #color #programmatically
ADD COMMENT
Topic
Name
3+7 =