Frage

I have a list of User ids as input to my android program, and would like to look them up on facebook to display names, pics, etc. I see a lot of tutorials on how to get the current users profile, and how to get that users friends. I even see tutorials on how to search for users by name (passing id does nothing). Is there no way to say "Give me the profile this id belongs to"?

War es hilfreich?

Lösung

You should not use the com.facebook.android.Facebook class anymore as its use is deprecated.

If you're using version 3.0 of the SDK, you can use the Request.newGraphPathRequest method, and just pass in the user id as the graphPath. Then in the callback, you can call response.getGraphObjectAs(GraphUser.class), which gives you a GraphUser that you can get the name from.

Andere Tipps

If you have a authorized facebook object you can use the request method to get more information:

String jsonstring = facebook.request(id);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top