skip to Main Content

Android Studio – Change layout background in Android Studio

Although I used to change the background with the code below, but now the program crashes binding.cardLAYOUT.setBackgroundResource( R.drawable.gift_card_100); or binding.cardLAYOUT.setBackground(ContextCompat.getDrawable(this, R.drawable.gift_card_1)); I did not change anything, the images and codes are the same as before <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/cardLAYOUT" android:layout_width="0dp" android:layout_height="0dp" android:layout_marginStart="24dp"…

VIEW QUESTION
Back To Top
Search