就我而言,我想从缓存加载数据。如果缓存有缓存加载,则从网络加载。如何在Ion中使用缓存?
private void loadION() {
final ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setMessage("loading");
progressDialog.show();
Ion.with(getApplicationContext()).load(url)
.setBodyParameter("tag", "annual_schedule").asString()
.setCallback(new FutureCallback<String>() {
@Override
public void onCompleted(Exception e, String str) {
Message.Toast(getApplicationContext(), str);
progressDialog.dismiss();
}
});
}