private void showPickerFragment(PickerFragment<?> fragment) { fragment.setOnErrorListener(new PickerFragment.OnErrorListener() { @Override public void onError(PickerFragment<?> pickerFragment, FacebookException error) { String text = getString(R.string.exception, error.getMessage()); Toast toast = Toast.makeText(HelloFacebookSampleActivity.this, text, Toast.LENGTH_SHORT); toast.show(); } }); FragmentManager fm = getSupportFragmentManager(); fm.beginTransaction() .replace(R.id.fragment_container, fragment) .addToBackStack(null) .commit(); controlsContainer.setVisibility(View.GONE); // We want the fragment fully created so we can use it immediately. fm.executePendingTransactions(); fragment.loadData(false); }
private void setFriendPickerListeners(final FriendPickerFragment fragment) { fragment.setOnDoneButtonClickedListener(new FriendPickerFragment.OnDoneButtonClickedListener() { @Override public void onDoneButtonClicked(PickerFragment<?> pickerFragment) { onFriendPickerDone(fragment); } }); }