This is because your return type
is void
public void getJSONFromUrl
Change the return type to String
and return
a String
.
In this line
String response = new JSONParser().getJSONFromUrl(makeURL(startLatitude,startLongitude,endLatitude,endtLongitude),new responseListener()
but the method clearly returns void
.
As Diego Suárez pointed out in a comment, there is no need for this response
variable...that is what the callback is for. You can change that to
new JSONParser().getJSONFromUrl(makeURL(startLatitude,startLongitude,endLatitude,endtLongitude),new responseListener()
And the callback will be initiated when onPostExecute()
finishes.