I have some problems with getting data from ion. I need to get variable from function and i know that this function ion is performed separately from the main stream. How can i get this data? Maybe i need to wait while function doesn't completed, but how can i do it?
final String someText;
Ion.with(this)
.load(URL)
.asString()
.setCallback(new FutureCallback<String>() {
@Override
public void onCompleted(Exception e, String result) {
someText = result.toString();
System.out.println(someText) // i get someText not empty
}
});
System.out.println(someText) // i get someText empty