Facebook的登录Android中LoginButton.setFragment [英] facebook login in android LoginButton.setFragment
本文介绍了Facebook的登录Android中LoginButton.setFragment的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有问题的LogginButton:
I have problem with the LogginButton:
LoginButton authButton = (LoginButton) v.findViewById(R.id.authButton);
authButton.setFragment(this);
我使用的片段,并非来自支持。
.setFragment
从支持获得唯一的片段。
I'm using Fragment that not from the support.
.setFragment
get only Fragment from the support.
如何解决? (有没有改变片段的支持)
How to fix it ? (with not to change to fragment from the support)
推荐答案
所以,在我的情况下切换到支持库是没办法我已经解决了这种方式:
So , in my case switching to the support library was no option i have solved it this way:
不要使用setFragment,而不是覆盖onActivityResult在Acitvity并从那里调用片段onActivityResult。
Don't use setFragment , instead override the onActivityResult in your Acitvity and call the fragment onActivityResult from there.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
_loginFragment.onActivityResult(requestCode, resultCode, data);
}
这篇关于Facebook的登录Android中LoginButton.setFragment的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文