I used the following code to get my facebook user profile, the problem is , when I trigger the newMeRequest, it never response.
The session is already opened and I have also add the internet permission at manifest.xml, how to fix it ? Thanks for helping
public class ProfileFragment extends Fragment {
private View rootView;
private ImageView profilePic;
private Context ctx;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ctx = getActivity();
rootView = inflater.inflate(R.layout.profile, container, false);
profilePic = (ImageView) rootView.findViewById(R.id.profile_pic);
Session session = Session.getActiveSession();
if (session.isOpened()) {
Log.d("test1","success 123");
Request.newMeRequest(session, new MeReqCallback());
} else {
Log.d("test1","fail 123");
}
return rootView;
}
private class MeReqCallback implements GraphUserCallback {
@Override
public void onCompleted(GraphUser user, Response response) {
Log.d("test1",response.getError().getErrorMessage());
new ImageLoader(ctx).execute(profilePic,"https://graph.facebook.com/"+ user.getId() +"/picture");
}
}
After logging, it fall into success 123, but it even did not fall into the onCompleted function , that means even no error message logged.
Thanks