/**
   * 显示移除黑名单对话框 @Title: showRemoveBlackDialog @Description: TODO
   *
   * @param @param position
   * @param @param invite
   * @return void
   * @throws
   */
  public void showRemoveBlackDialog(final int position, final BmobChatUser user) {
    DialogTips dialog =
        new DialogTips(this, "移出黑名单", "你确定将" + user.getUsername() + "移出黑名单吗?", "确定", true, true);
    // 设置成功事件
    dialog.SetOnSuccessListener(
        new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialogInterface, int userId) {
            adapter.remove(position);
            userManager.removeBlack(
                user.getUsername(),
                new UpdateListener() {

                  @Override
                  public void onSuccess() {
                    // TODO Auto-generated method stub
                    ShowToast("移出黑名单成功");
                    // 重新设置下内存中保存的好友列表
                    CustomApplcation.getInstance()
                        .setContactList(
                            CollectionUtils.list2map(
                                BmobDB.create(getApplicationContext()).getContactList()));
                  }

                  @Override
                  public void onFailure(int arg0, String arg1) {
                    // TODO Auto-generated method stub
                    ShowToast("移出黑名单失败:" + arg1);
                  }
                });
          }
        });
    // 显示确认对话框
    dialog.show();
    dialog = null;
  }
Ejemplo n.º 2
0
 public void showNotice() {
   DialogTips dialog =
       new DialogTips(
           this, "提示", getResources().getString(R.string.show_notice), "确定", true, true);
   // 设置成功事件
   dialog.SetOnSuccessListener(
       new DialogInterface.OnClickListener() {
         public void onClick(DialogInterface dialogInterface, int userId) {}
       });
   // 显示确认对话框
   dialog.show();
   dialog = null;
 }