void requestPushMsg(int pos, String type, String msg) { DeviceEntity e = (DeviceEntity) mDataList.get(pos); NetAPI.pushMessage( e.getDevid(), type, msg, mAppTypeEnt.getAppid(), mAppTypeEnt.getAppkey(), new Response.Listener() { @Override public void onResponse(Object response) { ResultResponse res = (ResultResponse) response; ToastUtil.showShortToast(getApplicationContext(), "" + res.getMsg()); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { ToastUtil.showShortToast(mContext, "error"); } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initIntent(); initList(); if (mAppTypeEnt != null) setTitle(mAppTypeEnt.getName()); }
private void requestRefresh(final int pos) { DeviceEntity e = (DeviceEntity) mDataList.get(pos); showProgressDialog(null, "Loading.."); NetAPI.refreshDevice( e.getDevid(), mAppTypeEnt.getAppid(), mAppTypeEnt.getAppkey(), new Response.Listener() { @Override public void onResponse(Object response) { ResultResponse res = (ResultResponse) response; if (res != null) { ToastUtil.showShortToast(mContext, res.getStatus()); if (res.getStatus().equals(Constant.ONLINE_DEVICE)) { } else { mDataList.remove(pos); mAdapter.notifyItemRemoved(pos); } } cancelProgressDialog(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { ToastUtil.showShortToast(mContext, "error"); cancelProgressDialog(); } }); }