你能告诉我如何保存我最后的回拨数据吗?我想离线使用它。 谢谢阅读 问候
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();