Java 类com.facebook.widget.PickerFragment 实例源码

项目:CodePix-Android    文件:HelloFacebookSampleActivity.java   
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);
}
项目:CodePix-Android    文件:HelloFacebookSampleActivity.java   
private void setFriendPickerListeners(final FriendPickerFragment fragment) {
    fragment.setOnDoneButtonClickedListener(new FriendPickerFragment.OnDoneButtonClickedListener() {
        @Override
        public void onDoneButtonClicked(PickerFragment<?> pickerFragment) {
            onFriendPickerDone(fragment);
        }
    });
}