Answers for "set icon to fab programmatically in android studio"

0

set icon to fab programmatically in android studio

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            floatingActionButton.setImageDrawable(getResources().getDrawable(R.drawable.ic_full_sad, context.getTheme()));
        } else {
            floatingActionButton.setImageDrawable(getResources().getDrawable(R.drawable.ic_full_sad));
    }
Posted by: Guest on October-08-2020
0

change fab image programatically

floatingActionButton.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_full_sad));
Posted by: Guest on April-22-2020

Code answers related to "set icon to fab programmatically in android studio"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language