use of org.awesomeapp.messenger.service.IContactListManager in project Zom-Android by zom.
the class ContactListFilterView method removeContact.
void removeContact(Cursor c) {
final IImConnection conn = getConnection(c);
String nickname = c.getString(c.getColumnIndexOrThrow(Imps.Contacts.NICKNAME));
final String address = c.getString(c.getColumnIndexOrThrow(Imps.Contacts.USERNAME));
DialogInterface.OnClickListener confirmListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
try {
IContactListManager manager = conn.getContactListManager();
int res = manager.removeContact(address);
if (res != ImErrorInfo.NO_ERROR) {
mHandler.showAlert(R.string.error, ErrorResUtils.getErrorRes(getResources(), res, address));
}
} catch (RemoteException e) {
mHandler.showServiceErrorAlert(e.getLocalizedMessage());
LogCleaner.error(ImApp.LOG_TAG, "remote error", e);
}
}
};
Resources r = getResources();
new AlertDialog.Builder(mContext).setTitle(R.string.confirm).setMessage(r.getString(R.string.confirm_delete_contact, nickname)).setPositiveButton(R.string.yes, // default button
confirmListener).setNegativeButton(R.string.no, null).setCancelable(false).show();
}
Aggregations