@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(); } } } }
@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(); } } } }
@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(); } } } }
@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(); } } } }
@Override protected void onBubbleClick() { String filePath = fileMessageBody.getLocalUrl(); File file = new File(filePath); if (file != null && file.exists()) { // 文件存在,直接打开 FileUtils.openFile(file, (Activity) context); } else { // 下载 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(); } } } }
@Override public void onBubbleClick(EMMessage message) { EMNormalFileMessageBody fileMessageBody = (EMNormalFileMessageBody) message.getBody(); String filePath = fileMessageBody.getLocalUrl(); File file = new File(filePath); if (file.exists()) { // open files if it exist FileUtils.openFile(file, (Activity) getContext()); } else { // download the file getContext().startActivity(new Intent(getContext(), EaseShowNormalFileActivity.class).putExtra("msg", message)); } if (message.direct() == EMMessage.Direct.RECEIVE && !message.isAcked() && message.getChatType() == EMMessage.ChatType.Chat) { try { EMClient.getInstance().chatManager().ackMessageRead(message.getFrom(), message.getMsgId()); } catch (HyphenateException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }