use of com.xabber.android.ui.activity.ContactActivity in project xabber-android by redsolution.
the class ContactDeleteDialogFragment method onClick.
@Override
public void onClick(DialogInterface dialog, int which) {
if (which == Dialog.BUTTON_POSITIVE) {
MessageManager.getInstance().closeChat(account, user);
try {
// discard subscription
PresenceManager.getInstance().discardSubscription(account, user);
} catch (NetworkException e) {
Application.getInstance().onError(R.string.CONNECTION_FAILED);
}
// delete chat
AbstractChat chat = MessageManager.getInstance().getChat(account, user);
if (chat != null)
MessageManager.getInstance().removeChat(chat);
// remove roster contact
RosterManager.getInstance().removeContact(account, user);
if (getActivity() instanceof ContactActivity) {
startActivity(ContactListActivity.createIntent(getActivity()));
}
}
}
Aggregations