我正在努力工作,但我不能。我想登录facebook,但我现在不知道。任何例子?
public class login extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle saveStanceState){
View view = inflater.inflate(R.layout.activity_login, container, false);
loginButton = (LoginButton) view.findViewById(R.id.login_button);
loginButton.setReadPermissions("user_friends");
loginButton.setFragment(this);
// Callback registration
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
});
return inflater.inflate(R.layout.activity_login, container, false);
}
答案 0 :(得分:0)
您的return
用于新的View
,您的代码应如下所示:
View view = inflater.inflate(R.layout.activity_login, container, false);
...
return view;