Question Detail

how to set floating button icon programmatically?

4 years ago Views 931 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

- 4 years ago

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

fab.setImageResource(R.drawable.ic_save);