use of com.facebook.internal.FacebookDialogFragment in project facebook-android-sdk by facebook.
the class WebViewLoginMethodHandler method tryAuthorize.
@Override
boolean tryAuthorize(final LoginClient.Request request) {
Bundle parameters = getParameters(request);
WebDialog.OnCompleteListener listener = new WebDialog.OnCompleteListener() {
@Override
public void onComplete(Bundle values, FacebookException error) {
onWebDialogComplete(request, values, error);
}
};
e2e = LoginClient.getE2E();
addLoggingExtra(ServerProtocol.DIALOG_PARAM_E2E, e2e);
FragmentActivity fragmentActivity = loginClient.getActivity();
WebDialog.Builder builder = new AuthDialogBuilder(fragmentActivity, request.getApplicationId(), parameters).setE2E(e2e).setIsRerequest(request.isRerequest()).setOnCompleteListener(listener);
loginDialog = builder.build();
FacebookDialogFragment dialogFragment = new FacebookDialogFragment();
dialogFragment.setRetainInstance(true);
dialogFragment.setDialog(loginDialog);
dialogFragment.show(fragmentActivity.getSupportFragmentManager(), FacebookDialogFragment.TAG);
return true;
}
use of com.facebook.internal.FacebookDialogFragment in project facebook-android-sdk by facebook.
the class FacebookActivity method getFragment.
protected Fragment getFragment() {
Intent intent = getIntent();
FragmentManager manager = getSupportFragmentManager();
Fragment fragment = manager.findFragmentByTag(FRAGMENT_TAG);
if (fragment == null) {
if (FacebookDialogFragment.TAG.equals(intent.getAction())) {
FacebookDialogFragment dialogFragment = new FacebookDialogFragment();
dialogFragment.setRetainInstance(true);
dialogFragment.show(manager, FRAGMENT_TAG);
fragment = dialogFragment;
} else if (DeviceShareDialogFragment.TAG.equals(intent.getAction())) {
DeviceShareDialogFragment dialogFragment = new DeviceShareDialogFragment();
dialogFragment.setRetainInstance(true);
dialogFragment.setShareContent((ShareContent) intent.getParcelableExtra("content"));
dialogFragment.show(manager, FRAGMENT_TAG);
fragment = dialogFragment;
} else {
fragment = new LoginFragment();
fragment.setRetainInstance(true);
manager.beginTransaction().add(R.id.com_facebook_fragment_container, fragment, FRAGMENT_TAG).commit();
}
}
return fragment;
}
Aggregations