Since on button, we can use android:drawableLeft to set the drawable on the left of a button. Is there way to get this drawable programmatically?
<Button android:id="@+id/detail_refresh_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="@string/refresh"
android:gravity="center"
android:drawableLeft="@drawable/progress"
/>
Is there any way to get the drawable “progress” in Java code?
I think you want
Button.getCompoundDrawables()[0]