您好,这是代码,它确实检索用户信息,但是当我将其转换为 apk 时,它不会检索任何用户信息。请帮助:
GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(),
new GraphRequest.GraphJSONObjectCallback()
{
@Override
public void onCompleted(JSONObject object, GraphResponse response)
{
Log.i("LetsMeetFragment" + response.toString());
// imageURL = new URL(" https://graph.facebook.com/ " + userID + "/picture?width=" + width +"&height=" + height); // InputStream inputStream = (InputStream) imageURL.getContent(); // bitmap = getCroppedBitmap(BitmapFactory.decodeStream(inputStream));
try
{
String userID = (String) object.get("id");
letsMeetFlow.getUserUpdateRequestObj().setFb_id(userID);
BService.setFacebookID(userID);BService.setFacebookConnected(true);
PreferenceConnector.writeString(getContext(),ApplicationConstants.FacebookID, userID);
String userName = (String) object.get("name");
String DOB = (String) object.get("birthday");
String Gender = (String) object.get("gender");
if (Gender.equalsIgnoreCase("male"))
{
manSeletion();
}
setBODField(DOB);
String[] userNamearray = userName.split(" ");
if (userNamearray.length > 1)
{
String tmpName = "";
for (int i = 0; i < userNamearray.length - 1; i++)
{
tmpName += userNamearray[i] + " ";
}
NameField.setText(tmpName.trim());
LastNameField.setText(userNamearray[userNamearray
.length - 1].trim());
}