Search
 
SCRIPT & CODE EXAMPLE
 

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));
Comment

android studio change button color programmatically

Button11.setBackgroundColor(0xFFFF0000); // 0xAARRGGBB
Comment

android studio change button color programmatically

startBtn.getBackground().setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_ATOP);
Comment

cant change button color when app run android studio

replace <Button with <androidx.appcompat.widget.AppCompatButton
Comment

button color dosn change in android

<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
change this to :
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
Comment

PREVIOUS NEXT
Code Example
Java :: dot operator java 
Java :: print array 
Java :: read timed out android studio 
Java :: big java 2010 heaptree java program 
Java :: programmatically click button javafx 
Java :: java using .indexof to fin a space 
Java :: java create new object 
Java :: java program for multiplication table 
Java :: make textview invisible android 
Java :: importing all java libraries 
Java :: java standard exception 
Java :: Caused by: java.lang.ClassNotFoundException 
Java :: crear objetos automaticamente java 
Java :: delete one item from list recycleview 
Java :: add character to a string java 
Java :: Java heap retention in BodyContentImpl 
Java :: Add month to date in java 8 
Java :: convert integer array to string array 
Java :: java string literals 
Java :: java instanceof 
Java :: how to check if user is logged in firebase android and then load another activity 
Java :: fixed length array powershell PSv5+ 
Java :: java search arraylist 
Java :: Java printf() Method 
Java :: commenting in java 
Java :: zweidimensionales array ausgeben java 
Java :: android studio setBackground 
Java :: java difference hashmap hashtable 
Java :: java structure example 
Java :: how to create set java 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =