'why is this button doesn't change appearance even though I already change the background color

enter image description here

please help me change the button color in android studio



Solution 1:[1]

Use AppcompatButton and give any backgroud you want to give

<androidx.appcompat.widget.AppCompatButton
        android:id="@+id/edit_text_delay"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="number"
        android:background=""
        android:ems="10"
        />

Solution 2:[2]

Use android:backgroundTint

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    android:text="Hello"
    android:backgroundTint="@color/black"/>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Heri moradiya
Solution 2 Rushikesh Sanghani