org.jivesoftware.smack.chat.ChatManager Java Examples

The following examples show how to use org.jivesoftware.smack.chat.ChatManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActivityChatScreen.java    From XMPPSample_Studio with Apache License 2.0 6 votes vote down vote up
@SuppressLint("NewApi")
    @Override
    protected void onDestroy() {

//        XMPP.getInstance().getConnection(acitiviy).getRoster()
//                .removeRosterListener(rosterListener);
        Roster.getInstanceFor(XMPP.getInstance().getConnection(acitiviy)).removeRosterListener(rosterListener);
        ChatManager.getInstanceFor(XMPP.getInstance().getConnection(acitiviy))
                .removeChatListener(chatListener);
        if (chat != null && messageListener != null) {
            chat.removeMessageListener(messageListener);
        }

        if (popupWindow != null) {
            popupWindow.dismiss();
        }
        if (emoticonsCover != null) {
            emoticonsCover.setVisibility(View.GONE);
        }

        // actionBar.setIcon(R.drawable.ic_launcher);

        super.onDestroy();
    }
 
Example #2
Source File: RoomsListManager.java    From mangosta-android with Apache License 2.0 4 votes vote down vote up
public ChatManager getChatManager() {
    return ChatManager.getInstanceFor(XMPPSession.getInstance().getXMPPConnection());
}