- Forum posts: 2
Aug 8, 2018, 11:22:39 AM via Website
Aug 8, 2018 11:22:39 AM via Website
I am working as an Android developer. I am facing an issue is I can't access the results inside the onCompleted method, I want to get the data from an onCompleted method and send to my view.
public double walletApiCall(final Activity myactivity, final String addresses) {
double unCon_balance;
Ion.with(myactivity)
.load(URL)
.asString()
.setCallback(new FutureCallback<String>() {
@Override
public void onCompleted(Exception e, String result) {
JSONObject tomJsonObject = null;
try {
tomJsonObject = new JSONObject(result);
} catch (JSONException e1) {
e1.printStackTrace();
}
walletApiCall(result,myactivity);
System.out.println("unCon_balance2: "+ unCon_balance);
}
});
return unCon_balance;
}
Thanks & Regards
Camillelola
Mindmajix.com