Question Detail

how to set floating button icon programmatically?

6 years ago Views 1564 Visit Post Reply

How to set android:src Icon through programmatically?
I have tried 

fab.setImageResource(getResources().getDrawable(R.drawable.ic_save));


Thread Reply

Anonymous

- 6 years ago

there is an only small mistake you have done.
try this: 

fab.setImageResource(R.drawable.ic_save);