private void setFriendPickerListeners(final FriendPickerFragment fragment) { fragment.setOnDoneButtonClickedListener( new FriendPickerFragment.OnDoneButtonClickedListener() { public void onDoneButtonClicked(PickerFragment<?> pickerFragment) { onFriendPickerDone(fragment); } }); }
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); }