Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asyncHttpClient no onSuccess or onFailure run

I'm trying to connect means AsyncHttpClient to a php script on my website. The script do the html parsing of another page, and convert the result to json. it work well. But, when I try to take the json form java for using it on android, the method that have the only work of open a stream and return 'response', doesn't run onSuccess and onFailure both. can anyone help me? Here the code:

private String getStream() {

    AsyncHttpClient client = new AsyncHttpClient();

    client.get("http://jem88.net/eventsAroundYouParser.php", new AsyncHttpResponseHandler() {
         @Override
         public void onSuccess(String response) {

             System.out.println("response is here..."+response);
             Log.d("eventstaker", "into response!!");

         }

         @Override
         public void onFailure(Throwable e, String response) {
             Log.d("eventstaker", "onFailure method is run... :(");
         }

     });
    return "";
}`

I've set the internet and network_access permission in the manifest. Thank you in advance

like image 875
Marino Avatar asked Oct 21 '22 09:10

Marino


1 Answers

You can override more onFailure methods

like image 142
mromer Avatar answered Oct 24 '22 02:10

mromer