Пример #1
0
  @Override
  protected void initHXOptions() {
    super.initHXOptions();

    // you can also get EMChatOptions to set related SDK options
    EMChatOptions options = EMChatManager.getInstance().getChatOptions();
    options.allowChatroomOwnerLeave(getModel().isChatroomOwnerLeaveAllowed());
  }
Пример #2
0
  @Override
  protected void initListener() {
    super.initListener();
    IntentFilter callFilter =
        new IntentFilter(EMChatManager.getInstance().getIncomingCallBroadcastAction());
    if (callReceiver == null) {
      callReceiver = new CallReceiver();
    }

    // 注册通话广播接收者
    appContext.registerReceiver(callReceiver, callFilter);
    // 注册消息事件监听
    initEventListener();
  }
Пример #3
0
  @Override
  public void logout(final boolean unbindDeviceToken, final EMCallBack callback) {
    endCall();
    super.logout(
        unbindDeviceToken,
        new EMCallBack() {

          @Override
          public void onSuccess() {
            // TODO Auto-generated method stub
            setContactList(null);
            setRobotList(null);
            getUserProfileManager().reset();
            getModel().closeDB();
            if (callback != null) {
              callback.onSuccess();
            }
          }

          @Override
          public void onError(int code, String message) {
            // TODO Auto-generated method stub
            if (callback != null) {
              callback.onError(code, message);
            }
          }

          @Override
          public void onProgress(int progress, String status) {
            // TODO Auto-generated method stub
            if (callback != null) {
              callback.onProgress(progress, status);
            }
          }
        });
  }