change android app icon programmatically code example
Example: 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));
}