I am making a Birthday Reminder App, in which i am allowing user to add birthdays for their friends those numbers are stored in Phone Book
Now i am trying to do small change, like here i want if User has already added birthday for Phonebook friend then no need to show AddBirthday button, and if user has not added birthday for Phonebook friend then need to show AddBirthday button.
like in my phone book, person name Akshat for him i have already added birthday, but here i am also getting AddBirthday button, but now i want to disable this AddBirthday Button
AccountDatesOfBirthAdapter.java:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (position == 0) {
if (convertView == null) {
convertView = this.inflater.inflate(R.layout.editor_account, null);
}
ImageView accountIcon = (ImageView) convertView.findViewById(R.id.editor_icon);
accountIcon.setImageDrawable(this.accountIcon);
TextView accountType = (TextView) convertView.findViewById(R.id.editor_type);
accountType.setText(this.accountType);
TextView accountName = (TextView) convertView.findViewById(R.id.editor_name);
accountName.setText(this.accountName);
// To Do:: Enable and Disable button (Birthday Added or not)
addDateOfBirth = (ImageButton) convertView.findViewById(R.id.editor_new);
addDateOfBirth.setOnClickListener(this);
}
else
{
DateOfBirth dateOfBirth = this.datesOfBirth.get(position - 1);
if (convertView == null) {
convertView = this.inflater.inflate(R.layout.editor_dateofbirth, null);
}
TextView date = (TextView) convertView.findViewById(R.id.editor_date);
date.setText(dateFormatter.format(dateOfBirth.getDate().getTime()));
}
return convertView;
}