Question : android studio change button color programmatically
Answered by : tough-toucan-7owaoshfh4vf
// 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));
Source : | Last Update : Wed, 17 Mar 21
Question : android studio change button color programmatically
Answered by : tough-toucan-7owaoshfh4vf
Button11.setBackgroundColor(0xFFFF0000); // 0xAARRGGBB
Source : | Last Update : Wed, 17 Mar 21
Question : button color dosn change in android
Answered by : vast-vicua-ja64o9494q88
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
change this to :
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
Source : | Last Update : Thu, 03 Feb 22