com.hyphenate.exceptions.HyphenateException.printStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中com.hyphenate.exceptions.HyphenateException.printStackTrace()方法的一些代码示例,展示了HyphenateException.printStackTrace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HyphenateException.printStackTrace()方法的具体详情如下:
包路径:com.hyphenate.exceptions.HyphenateException
类名称:HyphenateException
方法名:printStackTrace

HyphenateException.printStackTrace介绍

暂无

代码示例

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void run(){
    try {
      EMClient.getInstance().groupManager().getJoinedGroupsFromServer();
      handler.sendEmptyMessage(0);
    } catch (HyphenateException e) {
      e.printStackTrace();
      handler.sendEmptyMessage(1);
    }
  }
}.start();

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void run() {
    try {
      EMClient.getInstance().groupManager().getGroupFromServer(toChatUsername);
    } catch (HyphenateException e) {
      e.printStackTrace();
    }
  }
}).start();

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void run() {
    try {
      EMClient.getInstance().groupManager().getGroupFromServer(toChatUsername);
    } catch (HyphenateException e) {
      e.printStackTrace();
    }
  }
}).start();

代码示例来源:origin: huangfangyi/FanXin

/**
 * 移出免打扰
 * 
 * @param tobeRemoveUser
 */
private void removeOutBlacklist(final String tobeRemoveUser) {
  try {
    // 移出黑民单
    EMClient.getInstance().contactManager().removeUserFromBlackList(tobeRemoveUser);
    iv_switch_block_groupmsg.setVisibility(View.INVISIBLE);
    iv_switch_unblock_groupmsg.setVisibility(View.VISIBLE);
  }   catch (HyphenateException e) {
    runOnUiThread(new Runnable() {
      public void run() {
        Toast.makeText(getApplicationContext(), "设置失败",
            Toast.LENGTH_SHORT).show();
      }
    });
    e.printStackTrace();
  }
}

代码示例来源:origin: Vegen/SmartCampus

@Override
  public void run() {
    try {
      EMClient.getInstance().createAccount(phone, password);
      if (mView != null){
        mView.signUpSuccess();
      }
    } catch (final HyphenateException e) {
      e.printStackTrace();
      if (mView != null){
        mView.signUpError(e);
      }
    }
  }
}).start();

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void run() {
    try {
      EMClient.getInstance().groupManager().getJoinedGroupsFromServer();
      runOnUiThread(new Runnable() {
        @Override
        public void run() {
          grouplist = EMClient.getInstance().groupManager().getAllGroups();
          groupAdapter = new GroupsAdapter(GroupListActivity.this, grouplist);
          groupListView.setAdapter(groupAdapter);
          groupAdapter.notifyDataSetChanged();
        }
      });
    } catch (HyphenateException e) {
      e.printStackTrace();
    }
  }
}).start();

代码示例来源:origin: stevenwsg/XSY-University-trade

@Override
  protected void onBubbleClick() {
    String filePath = fileMessageBody.getLocalUrl();
    File file = new File(filePath);
    if (file.exists()) {
      // open files if it exist
      FileUtils.openFile(file, (Activity) context);
    } else {
      // download the file
      context.startActivity(new Intent(context, EaseShowNormalFileActivity.class).putExtra("msg", message));
    }
    if (message.direct() == EMMessage.Direct.RECEIVE && !message.isAcked() && message.getChatType() == ChatType.Chat) {
      try {
        EMClient.getInstance().chatManager().ackMessageRead(message.getFrom(), message.getMsgId());
      } catch (HyphenateException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    
  }
}

代码示例来源:origin: huangfangyi/FanXin

@Override
  protected void onBubbleClick() {
    String filePath = fileMessageBody.getLocalUrl();
    File file = new File(filePath);
    if (file != null && file.exists()) {
      // open files if it exist
      FileUtils.openFile(file, (Activity) context);
    } else {
      // download the file
      context.startActivity(new Intent(context, EaseShowNormalFileActivity.class).putExtra("msgbody", message.getBody()));
    }
    if (message.direct() == EMMessage.Direct.RECEIVE && !message.isAcked() && message.getChatType() == ChatType.Chat) {
      try {
        EMClient.getInstance().chatManager().ackMessageRead(message.getFrom(), message.getMsgId());
      } catch (HyphenateException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    
  }
}

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void run() {
    //从服务器获取自己加入的和创建的群组列表,此api获取的群组sdk会自动保存到内存和db。
    try {
      List<EMGroup> grouplist = EMClient.getInstance().groupManager().getJoinedGroupsFromServer();//需异步处理
      for(   EMGroup emGroup:   grouplist){
        EMGroup group = EMClient.getInstance().groupManager().getGroupFromServer(emGroup.getGroupId());
        if(group!=null&&group.getGroupId()!=null){
          Bundle bundle=new Bundle();
          bundle.putString("groupId",group.getGroupId());
          bundle.putString("groupName",group.getGroupName());
          Message msg=handler.obtainMessage();
          msg.what=1000;
          msg.setData(bundle);
          msg.sendToTarget();
        }
      }
    } catch (HyphenateException e) {
      e.printStackTrace();
    }
  }
}).start();

代码示例来源:origin: huangfangyi/FanXin

/**
 * move out of blacklist
 * 
 * @param tobeRemoveUser
 */
void removeOutBlacklist(final String tobeRemoveUser) {
  final String st2 = getResources().getString(R.string.Removed_from_the_failure);
  try {
    EMClient.getInstance().groupManager().unblockUser(groupId, tobeRemoveUser);
    adapter.remove(tobeRemoveUser);
  } catch (HyphenateException e) {
    e.printStackTrace();
    runOnUiThread(new Runnable() {
      public void run() {
        Toast.makeText(getApplicationContext(), st2, 0).show();
      }
    });
  }
}

代码示例来源:origin: stevenwsg/XSY-University-trade

@Override
  public void run() {
    try {
      EMClient.getInstance().chatManager().fetchHistoryMessages(
          toChatUsername, EaseCommonUtils.getConversationType(chatType), pagesize, "");
      final List<EMMessage> msgs = conversation.getAllMessages();
      int msgCount = msgs != null ? msgs.size() : 0;
      if (msgCount < conversation.getAllMsgCount() && msgCount < pagesize) {
        String msgId = null;
        if (msgs != null && msgs.size() > 0) {
          msgId = msgs.get(0).getMsgId();
        }
        conversation.loadMoreMsgFromDB(msgId, pagesize - msgCount);
      }
      messageList.refreshSelectLast();
    } catch (HyphenateException e) {
      e.printStackTrace();
    }
  }
});

代码示例来源:origin: Vegen/SmartCampus

@Override
  public void run() {
    try {
      EMClient.getInstance().chatManager().fetchHistoryMessages(
          toChatUsername, EaseCommonUtils.getConversationType(chatType), pagesize, "");
      final List<EMMessage> msgs = conversation.getAllMessages();
      int msgCount = msgs != null ? msgs.size() : 0;
      if (msgCount < conversation.getAllMsgCount() && msgCount < pagesize) {
        String msgId = null;
        if (msgs != null && msgs.size() > 0) {
          msgId = msgs.get(0).getMsgId();
        }
        conversation.loadMoreMsgFromDB(msgId, pagesize - msgCount);
      }
      messageList.refreshSelectLast();
    } catch (HyphenateException e) {
      e.printStackTrace();
    }
  }
});

代码示例来源:origin: huangfangyi/FanXin

public void run() {
    //get detail from server
    try {
      group = EMClient.getInstance().groupManager().getGroupFromServer(groupid);
      runOnUiThread(new Runnable() {
        public void run() {
          showGroupDetail();
        }
      });
    } catch (final HyphenateException e) {
      e.printStackTrace();
      final String st1 = getResources().getString(R.string.Failed_to_get_group_chat_information);
      runOnUiThread(new Runnable() {
        public void run() {
          progressBar.setVisibility(View.INVISIBLE);
          Toast.makeText(GroupSimpleDetailActivity.this, st1+e.getMessage(), 1).show();
        }
      });
    }
    
  }
}).start();

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void run() {
    try {
      List<EMContact> mList = EMClient.getInstance().getRobotsFromServer();
      callback.onSuccess(mList);
    } catch (HyphenateException e) {
      e.printStackTrace();
      callback.onError(e.getErrorCode(), e.toString());
    }
  }
}).start();

代码示例来源:origin: huangfangyi/FanXin

public void run() {
    try {
      EMClient.getInstance().contactManager().removeUserFromBlackList(tobeRemoveUser);
      runOnUiThread(new Runnable() {
        public void run() {
          pd.dismiss();
          adapter.remove(tobeRemoveUser);
        }
      });
    } catch (HyphenateException e) {
      e.printStackTrace();
      runOnUiThread(new Runnable() {
        public void run() {
          pd.dismiss();
          Toast.makeText(getApplicationContext(), R.string.Removed_from_the_failure, 0).show();
        }
      });
    }
  }
}).start();

代码示例来源:origin: huangfangyi/FanXin

public void run() {
    try {
      EMClient.getInstance().groupManager().changeGroupName(groupId, returnData);
      runOnUiThread(new Runnable() {
        public void run() {
          ((TextView) findViewById(R.id.group_name)).setText(returnData + "(" + group.getAffiliationsCount()
              + st);
          progressDialog.dismiss();
          Toast.makeText(getApplicationContext(), st6, 0).show();
        }
      });
      
    } catch (HyphenateException e) {
      e.printStackTrace();
      runOnUiThread(new Runnable() {
        public void run() {
          progressDialog.dismiss();
          Toast.makeText(getApplicationContext(), st7, 0).show();
        }
      });
    }
  }
}).start();

代码示例来源:origin: Vegen/SmartCampus

@Override
protected void handleReceiveMessage(EMMessage message) {
  if (!message.isAcked() && message.getChatType() == EMMessage.ChatType.Chat) {
    try {
      EMClient.getInstance().chatManager().ackMessageRead(message.getFrom(), message.getMsgId());
    } catch (HyphenateException e) {
      e.printStackTrace();
    }
  }
}

代码示例来源:origin: huangfangyi/FanXin

public void run() {
    try {
      //move to blacklist
      EMClient.getInstance().contactManager().addUserToBlackList(username,false);
      getActivity().runOnUiThread(new Runnable() {
        public void run() {
          pd.dismiss();
          Toast.makeText(getActivity(), st2, 0).show();
          refresh();
        }
      });
    } catch (HyphenateException e) {
      e.printStackTrace();
      getActivity().runOnUiThread(new Runnable() {
        public void run() {
          pd.dismiss();
          Toast.makeText(getActivity(), st3, 0).show();
        }
      });
    }
  }
}).start();

代码示例来源:origin: Vegen/SmartCampus

@Override
  protected void handleReceiveMessage(EMMessage message) {
    if (!message.isAcked() && message.getChatType() == EMMessage.ChatType.Chat) {
      try {
        EMClient.getInstance().chatManager().ackMessageRead(message.getFrom(), message.getMsgId());
      } catch (HyphenateException e) {
        e.printStackTrace();
      }
      return;
    }

    // Send the group-ack cmd type msg if this msg is a ding-type msg.
    EaseDingMessageHelper.get().sendAckMessage(message);
  }
}

代码示例来源:origin: Vegen/SmartCampus

private void ackMessage(EMMessage message) {
  EMMessage.ChatType chatType = message.getChatType();
  if (!message.isAcked() && chatType == EMMessage.ChatType.Chat) {
    try {
      EMClient.getInstance().chatManager().ackMessageRead(message.getFrom(), message.getMsgId());
    } catch (HyphenateException e) {
      e.printStackTrace();
    }
  }
  if (!message.isListened()) {
    EMClient.getInstance().chatManager().setVoiceMessageListened(message);
  }
}

相关文章

微信公众号

最新文章

更多