Issue
I have the following fab Icon but when i click it, the button's background doesn't change into save Icon.
fabEditAttendance = (FloatingActionButton) findViewById(R.id.fab_attendance_edit);
fabEditAttendance.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
fabEditAttendance.setBackgroundResource(android.R.drawable.ic_menu_save);
}
}
});
Solution
Solved : i had to use
setImageResource(int resID);
not
setbackgroundResource(int resID);
Solution Looks like this :
fabEditAttendance.setImageResource(android.R.drawable.ic_menu_save);
Answered By - erluxman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.