Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
Save last data in AQuery (Callback)
Bartosz Reterski
Greenhorn
Posts: 1
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello everybody . Could you tell me how can i save my last Callback data ? I would like to use it offline .
Thanks for reading
Regards
button_konwertuj.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final Double waluta_from_wartosc = Double.valueOf(editText_waluty.getText().toString()); String from_waluta = String.valueOf(spinner_from.getSelectedItem()); String to_waluta = String.valueOf(spinner_to.getSelectedItem()); String url = base_url + "from=" + from_waluta + "&to=" + to_waluta; aq.ajax(url, JSONObject.class, new AjaxCallback<JSONObject>() { @Override public void callback(String url, JSONObject json, AjaxStatus status) { if (json != null) { try { Double rate = json.getDouble("rate"); double the_result = waluta_from_wartosc * rate; textview_to.setText(String.valueOf(the_result) + " " + spinner_to.getSelectedItem().toString()); } catch (JSONException e) { e.printStackTrace(); } } else { Toast.makeText(aq.getContext(), "BRAK DOSTĘPU DO INTERNETU!!!", Toast.LENGTH_SHORT).show(); } } }); } }); }
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
android imageview animation resetting issue
Null Pointer Exception In Method
Check if available before save
Error cannot be cast to android.app.Activity
connect tandroid to mysql using php to insert new records
More...