0

I want to get the drawable id which is shown in the screen. I used if(getResources().getDrwable(binding.image1)==R.drawable.image){ //my stuff} But this is depreciated.

1 Answers1

3

You can use alternative of getResources().getDrawable(int id) as mentioned below

ContextCompat.getDrawable(Context context,int drawableId)
jayesh gurudayalani
  • 1,368
  • 1
  • 9
  • 14