Exemplo n.º 1
0
 @Override
 public boolean onContextItemSelected(MenuItem item) {
   if (item.getItemId() == R.id.remove) {
     final String tobeRemoveUser =
         adapter.getItem(((AdapterContextMenuInfo) item.getMenuInfo()).position);
     // 移出黑名单
     removeOutBlacklist(tobeRemoveUser);
     return true;
   }
   return super.onContextItemSelected(item);
 }
Exemplo n.º 2
0
 /**
  * 移出黑民单
  *
  * @param tobeRemoveUser
  */
 void removeOutBlacklist(final String tobeRemoveUser) {
   final String st2 = getResources().getString(R.string.Removed_from_the_failure);
   try {
     // 移出黑民单
     EMGroupManager.getInstance().unblockUser(groupId, tobeRemoveUser);
     adapter.remove(tobeRemoveUser);
   } catch (EaseMobException e) {
     e.printStackTrace();
     runOnUiThread(
         new Runnable() {
           public void run() {
             Toast.makeText(getApplicationContext(), st2, Toast.LENGTH_SHORT).show();
           }
         });
   }
 }