コード例 #1
0
 private void setFriendPickerListeners(final FriendPickerFragment fragment) {
   fragment.setOnDoneButtonClickedListener(
       new FriendPickerFragment.OnDoneButtonClickedListener() {
         public void onDoneButtonClicked(PickerFragment<?> pickerFragment) {
           onFriendPickerDone(fragment);
         }
       });
 }
コード例 #2
0
  private void onFriendPickerDone(FriendPickerFragment fragment) {
    FragmentManager fm = getSupportFragmentManager();
    fm.popBackStack();

    String results = "";

    Collection<GraphUser> selection = fragment.getSelection();
    if (selection != null && selection.size() > 0) {
      ArrayList<String> names = new ArrayList<String>();
      for (GraphUser user : selection) {
        names.add(user.getName());
      }
      results = TextUtils.join(", ", names);
    } else {
      results = "no friends";
    }

    showAlert("rar", results);
  }