I have an http module (not made by me):
To connect to a server and send a request, there is a method like
this:
public void sendRequest(String query){
....
}
When the server responds, it calls another method in the same class:
public void respons(String results){
....
}
I want to combine these two methods so that my application can use one
method looking something like this:
public String sendRequest(String xml){
....
}
which returns the results. Is this possible?
I think it must be to include the second method someway in the first
method and wait for the respons, but I don't know how to do so.
To summarize, the problem is to make one method return something when
another method is called. I guess there are some smart ways around
this problem, but I haven't found any yet.