Facebook login on android LoginButton.setFragment

I have a problem with LogginButton:

LoginButton authButton = (LoginButton) v.findViewById(R.id.authButton); authButton.setFragment(this); 

I use Fragment, but not out of support. .setFragment get only snippet from support.

How to fix it? (so as not to change the fragment from the support)

+3
android facebook
source share
2 answers

So, in my case, switching to the support library was not an option, I solved it like this:

Do not use setFragment, instead override onActivityResult in your Acitvity and call the onActivityResult fragment from there.

 @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); _loginFragment.onActivityResult(requestCode, resultCode, data); } 
+7
source share

Changing the snippet to android.support.v4.app.Fragment is the only solution.

+4
source share

All Articles