android - access facebook page information -


i want facebook page about, description, location, basic info etc. have got access token page. getting likes of page this:

public void getlikes (string id,final textview likes,final int position)     {         session session = session.getactivesession();         bundle params = new bundle();         params.putstring("id", id);         params.putstring("fields", "likes");         request request = new request(session, "search", params, httpmethod.get, new request.callback() {              @override             public void oncompleted(response response) {                 try {                     jsonobject res = response.getgraphobject().getinnerjsonobject().getjsonarray("data").getjsonobject(0);                     if (res.length()>1){                         likes.settext(string.valueof(res.getint("likes")));                         preferences.data.getdata().get(position).setlikes(string.valueof(res.getint("likes")));                     }                     else {                         preferences.data.getdata().get(position).setlikes("no likes");                         likes.settext("0");                     }                 } catch (exception e) {                 }             }         });         requestasynctask task = new requestasynctask(request);         task.execute();     } 

if add more parameters in bundle, value of last parameter added, should do. facebook's documentation graph api not clear.

this isn't issue specific api, you're using 1 field of response (.getjsonobject(0))

if request multiple fields need @ each of them, you're fetching first


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -