How to Android koush/ion get data?

  • Replies:4
  • OpenNot stickiedUnanswered
  • Forum posts: 2

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

Reply
  • Forum posts: 901

Aug 8, 2018, 3:51:36 PM via Website

Sorry that I am not clear about Ion and Itscallback method. But it seems that there are at least two potential questions:
1. does not set value to unCon_balance
2. does not return tomJsonObject

Do you think so?

Size 0.07 MB? Google Play - https://goo.gl/ws42fN
Google Blog - https://okblackcoffee.blogspot.com

Helpful?
Reply
  • Forum posts: 2

Aug 9, 2018, 6:21:38 AM via Website

Hi James,

Thanks for your reply. I don't know what exactly... so, that's why I am asking

Helpful?
Reply
  • Forum posts: 11

Aug 13, 2018, 4:52:38 AM via Website

Sure . i think so that .

Helpful?
Reply

Recommended articles