Im trying to do a FQL query in my android application with AQuery
. In the first FQL Query i got the JSON
just normal, but when i scroll my list to get more posts (calling another method using created_time comparisons ) i got a network error e aquery and the JSON
is null.
If i test the url in my browser, it runs correctly and returns the json data, but when i run with android, i get this network error and json comes null.
Anyone can give me a help?
This is the method called when i scroll:
public void callJsonNext(){
progress_bottom.setVisibility(View.VISIBLE);
final AQuery aq = new AQuery(getActivity());
String URL = URL_postagens_passadas + created_time_olds + "limit%2010&access_token=" + access_token;
Log.d("URL_CALL_JSON_NEXT", URL);
aq.ajax(URL, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
Log.d("STATUS_NEXT", status.toString());
if(json != null){
fillArrayWithOlderPosts(json);
}else{
Toast.makeText(aq.getContext(), "Error:" + status.getCode() + " in Json Next" + status.getError() + status.getMessage() + status.getSource(), Toast.LENGTH_LONG).show();
Toast.makeText(aq.getContext(), "Error:" + status.getCode() + " in Json Next" + status.getError() + status.getMessage() + status.getSource(), Toast.LENGTH_LONG).show();
}
}
});
}