• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java HyphenateException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.hyphenate.exceptions.HyphenateException的典型用法代码示例。如果您正苦于以下问题:Java HyphenateException类的具体用法?Java HyphenateException怎么用?Java HyphenateException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HyphenateException类属于com.hyphenate.exceptions包,在下文中一共展示了HyphenateException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onBubbleClick

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@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();
        }
    }
    
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:22,代码来源:EaseChatRowFile.java


示例2: onActivityResult

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode == RESULT_OK) {
        // 获取返回的准备邀请的群成员信息
        final String[] memberses = data.getStringArrayExtra("members");

        Model.getInstance().getGlobalThreadPool().execute(new Runnable() {
            @Override
            public void run() {
                try {
                    // 去环信服务器,发送邀请信息
                    EMClient.getInstance().groupManager().addUsersToGroup(mGroup.getGroupId(), memberses);

                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            Toast.makeText(GroupDetailActivity.this, "发送邀请成功", Toast.LENGTH_SHORT).show();
                        }
                    });
                } catch (final HyphenateException e) {
                    e.printStackTrace();

                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            Toast.makeText(GroupDetailActivity.this, "发送邀请失败" + e.toString(), Toast.LENGTH_SHORT).show();
                        }
                    });
                }
            }
        });
    }
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:36,代码来源:GroupDetailActivity.java


示例3: registerEaseMob

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
/**
 * 注册到环信
 * @param userName
 * @param pwd
 */
private void registerEaseMob(final String userName, final String pwd) {
    ThreadUtils.runOnBackgroundThread(new Runnable() {
        @Override
        public void run() {
            try {
                EMClient.getInstance().createAccount(userName, pwd);
                ThreadUtils.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        mRegisterView.onRegisterSuccess();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();
                ThreadUtils.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        mRegisterView.onRegisterError();
                    }
                });
            }
        }
    });
}
 
开发者ID:Vicent9920,项目名称:FanChat,代码行数:30,代码来源:RegisterPresenterImpl.java


示例4: deleteFriend

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
/**
 * 删除联系人
 * @param name
 */
@Override
public void deleteFriend(final String name) {
    ThreadUtils.runOnBackgroundThread(new Runnable() {
        @Override
        public void run() {
            try {
                EMClient.getInstance().contactManager().deleteContact(name);
                ThreadUtils.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        mContactView.onDeleteFriendSuccess();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();
                ThreadUtils.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        mContactView.onDeleteFriendFailed();
                    }
                });
            }
        }
    });
}
 
开发者ID:Vicent9920,项目名称:FanChat,代码行数:30,代码来源:ContactPresenterImpl.java


示例5: getContactsFromServer

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
/**
 *从服务器获取联系人列表
 */
@Override
public void getContactsFromServer() {
    if (mContactListItems.size() > 0) {
        mContactView.onGetContactListSuccess();
        return;
    }
    ThreadUtils.runOnBackgroundThread(new Runnable() {
        @Override
        public void run() {
            try {
                startGetContactList();
                notifyGetContactListSuccess();
            } catch (HyphenateException e) {
                e.printStackTrace();
                notifyGetContactListFailed();
            }
        }
    });

}
 
开发者ID:Vicent9920,项目名称:FanChat,代码行数:24,代码来源:ContactPresenterImpl.java


示例6: startGetContactList

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
/**
 * 获取联系人列表数据
 * @throws HyphenateException
 */
private void startGetContactList() throws HyphenateException {
    List<String> contacts = EMClient.getInstance().contactManager().getAllContactsFromServer();
    DatabaseManager.getInstance().deleteAllContacts();
    if (!contacts.isEmpty()) {
        for (int i = 0; i < contacts.size(); i++) {
            ContactListItem item = new ContactListItem();
            item.userName = contacts.get(i);
            if (itemInSameGroup(i, item)) {
                item.showFirstLetter = false;
            }
            mContactListItems.add(item);
            saveContactToDatabase(item.userName);
        }
    }
}
 
开发者ID:Vicent9920,项目名称:FanChat,代码行数:20,代码来源:ContactPresenterImpl.java


示例7: addFriend

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.BACKGROUND,priority = 90)
public void addFriend(AddFriendEvent event) {
    Log.d(TAG, "addFriend: ");
    try {
        EMClient.getInstance().contactManager().addContact(event.getFriendName(), event.getReason());
        ThreadUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                mAddFriendView.onAddFriendSuccess();
            }
        });
    } catch (HyphenateException e) {
        e.printStackTrace();
        ThreadUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                mAddFriendView.onAddFriendFailed();
            }
        });
    }
}
 
开发者ID:Vicent9920,项目名称:FanChat,代码行数:22,代码来源:AddFriendPresenterImpl.java


示例8: onBubbleClick

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@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();
        }
    }
    
}
 
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:22,代码来源:EaseChatRowFile.java


示例9: onBubbleClick

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@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();
        }
    }
    
}
 
开发者ID:HyphenateInc,项目名称:Hyphenate-EaseUI-Android,代码行数:22,代码来源:EaseChatRowFile.java


示例10: onSetUpView

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
protected void onSetUpView() {
    try {
        String currentUser = EMClient.getInstance().getCurrentUser();
        String fromUser = message.getStringAttribute(RedPacketConstant.EXTRA_RED_PACKET_SENDER_NAME);//红包发送者
        String toUser = message.getStringAttribute(RedPacketConstant.EXTRA_RED_PACKET_RECEIVER_NAME);//红包接收者
        String senderId;
        if (message.direct() == EMMessage.Direct.SEND) {
            if (message.getChatType().equals(EMMessage.ChatType.GroupChat)) {
                senderId = message.getStringAttribute(RedPacketConstant.EXTRA_RED_PACKET_SENDER_ID);
                if (senderId.equals(currentUser)) {
                    mTvMessage.setText(R.string.money_msg_take_money);
                } else {
                    mTvMessage.setText(String.format(getResources().getString(R.string.money_msg_take_someone_money), fromUser));
                }
            } else {
                mTvMessage.setText(String.format(getResources().getString(R.string.money_msg_take_someone_money), fromUser));
            }
        } else {
            mTvMessage.setText(String.format(getResources().getString(R.string.money_msg_someone_take_money), toUser));
        }
    } catch (HyphenateException e) {
        e.printStackTrace();
    }
}
 
开发者ID:laoduDYM,项目名称:ChatDemoUI3.0,代码行数:26,代码来源:ChatRowRedPacketAck.java


示例11: moveToBlacklist

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
/**
 * move user to blacklist
 */
protected void moveToBlacklist(final String username){
    final ProgressDialog pd = new ProgressDialog(getActivity());
    String st1 = getResources().getString(R.string.Is_moved_into_blacklist);
    final String st2 = getResources().getString(R.string.Move_into_blacklist_success);
    final String st3 = getResources().getString(R.string.Move_into_blacklist_failure);
    pd.setMessage(st1);
    pd.setCanceledOnTouchOutside(false);
    pd.show();
    new Thread(new Runnable() {
        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, Toast.LENGTH_SHORT).show();
                        refresh();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        Toast.makeText(getActivity(), st3, Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    }).start();
    
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:37,代码来源:EaseContactListFragment.java


示例12: onSetUpView

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
  protected void onSetUpView() {
locBody = (EMLocationMessageBody) message.getBody();
locationView.setText(locBody.getAddress());

// handle sending message
if (message.direct() == EMMessage.Direct.SEND) {
    setMessageSendCallback();
          switch (message.status()) {
          case CREATE: 
              progressBar.setVisibility(View.GONE);
              statusView.setVisibility(View.VISIBLE);
              break;
          case SUCCESS:
              progressBar.setVisibility(View.GONE);
              statusView.setVisibility(View.GONE);
              break;
          case FAIL:
              progressBar.setVisibility(View.GONE);
              statusView.setVisibility(View.VISIBLE);
              break;
          case INPROGRESS:
              progressBar.setVisibility(View.VISIBLE);
              statusView.setVisibility(View.GONE);
              break;
          default:
             break;
          }
      }else{
          if(!message.isAcked() && message.getChatType() == ChatType.Chat){
              try {
                  EMClient.getInstance().chatManager().ackMessageRead(message.getFrom(), message.getMsgId());
              } catch (HyphenateException e) {
                  e.printStackTrace();
              }
          }
      }
  }
 
开发者ID:turoDog,项目名称:KTalk,代码行数:39,代码来源:EaseChatRowLocation.java


示例13: handleTextMessage

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
protected void handleTextMessage() {
    if (message.direct() == EMMessage.Direct.SEND) {
        setMessageSendCallback();
        switch (message.status()) {
        case CREATE: 
            progressBar.setVisibility(View.GONE);
            statusView.setVisibility(View.VISIBLE);
            break;
        case SUCCESS:
            progressBar.setVisibility(View.GONE);
            statusView.setVisibility(View.GONE);
            break;
        case FAIL:
            progressBar.setVisibility(View.GONE);
            statusView.setVisibility(View.VISIBLE);
            break;
        case INPROGRESS:
            progressBar.setVisibility(View.VISIBLE);
            statusView.setVisibility(View.GONE);
            break;
        default:
           break;
        }
    }else{
        if(!message.isAcked() && message.getChatType() == ChatType.Chat){
            try {
                EMClient.getInstance().chatManager().ackMessageRead(message.getFrom(), message.getMsgId());
            } catch (HyphenateException e) {
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:34,代码来源:EaseChatRowText.java


示例14: add

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
private void add() {
    //去环信服务器添加好友
    Model.getInstance().getGlobalThreadPool().execute(new Runnable() {
        @Override
        public void run() {
            try {
                EMClient.getInstance().contactManager().addContact(userInfo.getName(),"添加好友");

                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(addContactActivity.this,"发送添加好友请求成功",Toast.LENGTH_SHORT).show();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(addContactActivity.this,"发送添加好友请求失败"+ e.toString(),Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    });
    
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:28,代码来源:addContactActivity.java


示例15: onAccept

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
public void onAccept(final InvationInfo invationInfo) {
    //通知环信服务器,点击了接受按钮
    Model.getInstance().getGlobalThreadPool().execute(new Runnable() {
        @Override
        public void run() {
            try {
                EMClient.getInstance().contactManager().
                        acceptInvitation(invationInfo.getUser().getHxid());

                //数据库更新
                Model.getInstance().getDbManager().getInviteTableDao().updateInvitationStatus(
                        InvationInfo.InvitationStatus.INVITE_ACCEPT,invationInfo.getUser().getHxid());

                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        //页面发生变化
                        Toast.makeText(InviteActivity.this,"已接受好友邀请",Toast.LENGTH_SHORT).show();

                        //刷新页面
                        refresh();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();

                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "接受邀请失败", Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    });

}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:39,代码来源:InviteActivity.java


示例16: onReject

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
public void onReject(InvationInfo invationInfo) {
    //通知环信服务器,点击了拒绝按钮
    Model.getInstance().getGlobalThreadPool().execute(new Runnable() {
        @Override
        public void run() {
            try {
                EMClient.getInstance().contactManager().
                        declineInvitation(invationInfo.getUser().getHxid());

                // 数据库变化
                Model.getInstance().getDbManager().getInviteTableDao().
                        removeInvitation(invationInfo.getUser().getHxid());

                //页面变化
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "已拒绝好友邀请", Toast.LENGTH_SHORT).show();

                        //刷新页面
                        refresh();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();

                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "拒绝邀请失败", Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    });

}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:39,代码来源:InviteActivity.java


示例17: onInviteAccept

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
public void onInviteAccept(InvationInfo invationInfo) {
    Model.getInstance().getGlobalThreadPool().execute(new Runnable() {
        @Override
        public void run() {
            try {
                // 告诉环信服务器接受了邀请
                EMClient.getInstance().groupManager().acceptInvitation(invationInfo.getGroup().getGroupId(), invationInfo.getGroup().getInvatePerson());

                // 本地数据更新
                invationInfo.setStatus(InvationInfo.InvitationStatus.GROUP_ACCEPT_INVITE);
                Model.getInstance().getDbManager().getInviteTableDao().addInvitation(invationInfo);

                // 内存数据的变化
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "接受邀请", Toast.LENGTH_SHORT).show();

                        // 刷新页面
                        refresh();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "接受邀请失败", Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    });
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:36,代码来源:InviteActivity.java


示例18: onInviteReject

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
public void onInviteReject(InvationInfo invationInfo) {
    Model.getInstance().getGlobalThreadPool().execute(new Runnable() {
        @Override
        public void run() {
            try {
                // 告诉环信服务器拒绝了邀请
                EMClient.getInstance().groupManager().declineInvitation(invationInfo.getGroup().getGroupId(), invationInfo.getGroup().getInvatePerson(),"拒绝邀请");

                // 更新本地数据库
                invationInfo.setStatus(InvationInfo.InvitationStatus.GROUP_REJECT_INVITE);
                Model.getInstance().getDbManager().getInviteTableDao().addInvitation(invationInfo);

                // 更新内存的数据
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "拒绝邀请", Toast.LENGTH_SHORT).show();

                        // 刷新页面
                        refresh();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();
            }
        }
    });
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:30,代码来源:InviteActivity.java


示例19: onApplicationAccept

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
public void onApplicationAccept(InvationInfo invationInfo) {
    Model.getInstance().getGlobalThreadPool().execute(new Runnable() {
        @Override
        public void run() {
            try {
                // 告诉环信服务器接受了申请
                EMClient.getInstance().groupManager().acceptApplication(invationInfo.getGroup().getGroupId(), invationInfo.getGroup().getInvatePerson());

                // 更新数据库
                invationInfo.setStatus(InvationInfo.InvitationStatus.GROUP_ACCEPT_APPLICATION);
                Model.getInstance().getDbManager().getInviteTableDao().addInvitation(invationInfo);

                // 更新内存
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "接受申请", Toast.LENGTH_SHORT).show();

                        refresh();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();
            }
        }
    });
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:29,代码来源:InviteActivity.java


示例20: onApplicationReject

import com.hyphenate.exceptions.HyphenateException; //导入依赖的package包/类
@Override
public void onApplicationReject(InvationInfo invationInfo) {
    Model.getInstance().getGlobalThreadPool().execute(new Runnable() {
        @Override
        public void run() {
            try {
                // 告诉环信服务器拒绝了申请
                EMClient.getInstance().groupManager().declineApplication(invationInfo.getGroup().getGroupId(),invationInfo.getGroup().getInvatePerson(),"拒绝申请");

                // 更新本地数据库
                invationInfo.setStatus(InvationInfo.InvitationStatus.GROUP_REJECT_APPLICATION);
                Model.getInstance().getDbManager().getInviteTableDao().addInvitation(invationInfo);

                // 更新内存
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "拒绝申请", Toast.LENGTH_SHORT).show();

                        refresh();
                    }
                });
            } catch (HyphenateException e) {
                e.printStackTrace();

                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(InviteActivity.this, "拒绝申请失败", Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    });
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:36,代码来源:InviteActivity.java



注:本文中的com.hyphenate.exceptions.HyphenateException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UndertowDeploymentInfoCustomizer类代码示例发布时间:2022-05-22
下一篇:
Java Node类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap