I'm having trouble working with async callbacks in Java/Android.
Currently, the object that handles my network calls looks like this:
class Reciever {
...
public String getData(String params) {
...
networkLibrary.runInBackground(String url, new networkCallback() {
public void done(String data, Exception e) {
// do something
};
};
What I'd like to be able to do is, in another object, make a call like:
data = reciever.getData();
doSomethingWith(data);
Is there a different strategy I should be trying here?