在我的Android应用程序中,我开发了此代码以使用我的帐户登录并获取用户属性,如姓名,位置和电子邮件.问题是我可以得到名字,但我无法收到电子邮件和位置.当我尝试我的代码而不尝试捕获应用程序粉碎和我的日志点getproperty("email")和getlocation().当我使用试试.应用程序工作但没有电子邮件或位置.
public class Share extends Fragment {private static final String TAG ="Share";private UiLifecycleHelper uiHelper;
private View otherView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// To maintain FB Login session
uiHelper = new UiLifecycleHelper(getActivity(), callback);
uiHelper.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.share, container, false);
// Looks for Login button
LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
authButton.setFragment(this);
// Set View that should be visible after log-in invisible initially
otherView …Run Code Online (Sandbox Code Playgroud)