Example #1
0
  @OnClick(R.id.btn_pack_post_volley)
  public void packPostVolley() {
    String url = "";
    HashMap<String, String> map = new HashMap<>();
    map.put("name", "qdh");
    map.put("age", "23");
    VolleyRequest2.RequestPost(
        this,
        url,
        "PackPostVolley",
        map,
        new VolleyInterface(this, VolleyInterface.mListener, VolleyInterface.mErrorListener) {
          @Override
          public void onMySuccess(String result) {}

          @Override
          public void onMyError(VolleyError error) {}
        });
  }
Example #2
0
  @OnClick(R.id.btn_packag_get_volley)
  public void packGetVolley() {
    String url = "";
    VolleyRequest2.RequestGet(
        this,
        url,
        "PackGetVolley",
        new VolleyInterface(this, VolleyInterface.mListener, VolleyInterface.mErrorListener) {
          @Override
          public void onMySuccess(String result) {
            // 请求成功时
          }

          @Override
          public void onMyError(VolleyError error) {
            // 请求失败时
          }
        });
  }