How to get a link to an image in complex drawings in Android?

If you have a text image + image as follows:

<TextView android:id="@+id/textView4" android:layout_width="0dp" android:layout_height="wrap_content" android:drawableRight="@drawable/calendar" /> 

How can you get an ImageView link from a textview link in java code? I want to set a click event for an image, not text.

Somebody knows?

Thanks.

+4
source share
1 answer

textView.getCompoundDrawables() will get drawableLeft , drawableRight , drawableTop and drawableBottom . And setCompoundDrawables() to set them.

+1
source

Source: https://habr.com/ru/post/1500968/


All Articles