Example #1
0
  public List<String> getInfo() throws WeiboException {

    String url = URLHelper.GROUP_MEMBER_LIST;

    Map<String, String> map = new HashMap<String, String>();
    map.put("access_token", access_token);
    map.put("uids", uids);

    String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);

    Gson gson = new Gson();

    List<GroupUser> value = null;
    try {
      value = gson.fromJson(jsonData, new TypeToken<List<GroupUser>>() {}.getType());
    } catch (JsonSyntaxException e) {
      AppLogger.e(e.getMessage());
    }

    if (value != null && value.size() > 0) {
      GroupUser user = value.get(0);
      List<String> ids = new ArrayList<String>();
      for (GroupBean b : user.lists) {
        ids.add(b.getIdstr());
      }
      return ids;
    }

    return null;
  }
  private String[] buildListNavData(List<GroupBean> list) {
    List<String> name = new ArrayList<String>();

    name.add(getString(R.string.all_people));
    name.add(getString(R.string.bilateral));

    for (GroupBean b : list) {
      name.add(b.getName());
    }

    String[] valueArray = name.toArray(new String[0]);
    return valueArray;
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   super.onCreateOptionsMenu(menu, inflater);
   inflater.inflate(R.menu.actionbar_menu_friendstimelinefragment, menu);
   name = menu.findItem(R.id.group_name);
   if (selectedId.equals("0")) {
     name.setTitle(userBean.getScreen_name());
   }
   if (selectedId.equals("1")) {
     name.setTitle(getString(R.string.bilateral));
   } else {
     for (GroupBean b : GlobalContext.getInstance().getGroup().getLists()) {
       if (b.getIdstr().equals(selectedId)) {
         name.setTitle(b.getName());
         return;
       }
     }
   }
 }