private void onFriendPickerDone(FriendPickerFragment fragment) { FragmentManager fm = getSupportFragmentManager(); fm.popBackStack(); String results = ""; List<GraphUser> selection = fragment.getSelection(); tags = selection; 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 = getString(R.string.no_friends_selected); } showAlert(getString(R.string.you_picked), results); }
public static void populateParameters(Intent intent, String userId, boolean multiSelect, boolean showTitleBar) { intent.putExtra(FriendPickerFragment.USER_ID_BUNDLE_KEY, userId); intent.putExtra(FriendPickerFragment.MULTI_SELECT_BUNDLE_KEY, multiSelect); intent.putExtra(FriendPickerFragment.SHOW_TITLE_BAR_BUNDLE_KEY, showTitleBar); }
private void setFriendPickerListeners(final FriendPickerFragment fragment) { fragment.setOnDoneButtonClickedListener(new FriendPickerFragment.OnDoneButtonClickedListener() { @Override public void onDoneButtonClicked(PickerFragment<?> pickerFragment) { onFriendPickerDone(fragment); } }); }
private void onClickPickFriends() { final FriendPickerFragment fragment = new FriendPickerFragment(); setFriendPickerListeners(fragment); showPickerFragment(fragment); }