As you see I want to show a Facebook profile picture in ImageView but unfortunately, the image URL is not working.
public void onCompleted(JSONObject object, GraphResponse response) {
Log.d("demo",object.toString());
try {
String name = object.getString("name");
String id = object.getString("id");
tvText.setText(name);
String imageURL = "https://graph.facbook.com/"+ id + "/picture type=small";
Glide.with(MainActivity.this).load(imageURL).error(R.drawable.com_facebook_button_icon).into(tvImg);
} catch (JSONException e) {
e.printStackTrace();
}
}
});
Bundle bundle = new Bundle();
bundle.putString("fields","name,id,first_name,last_name");
graphRequest.setParameters(bundle);
graphRequest.executeAsync();
Your URL String is incorrect.
Just replace this
String imageURL = "https://graph.facbook.com/"+ id + "/picture type=small";
to this
String imageURL = "https://graph.facebook.com/"+ id + "/picture type=small";
There was a missing "e" in the "facebook".