How to add list into params of volley Android?

前端 未结 2 1205
不思量自难忘°
不思量自难忘° 2020-12-20 07:47

Please help me how can i add a list in param of volley android like this

@Override
        protected Map getParams() throws AuthFailure         


        
相关标签:
2条回答
  • 2020-12-20 08:11

    Try like this

    @Override protected Map<String, Object> getParams() throws AuthFailureError {
        Map<String, Object> params = new HashMap<>();
        params.put("UGUID", UGUID);
        params.put("INAME", list);
        params.put("ARRAY_NAME",yourarray);
        return params;
    }
    
    0 讨论(0)
  • 2020-12-20 08:13

    if you want to send list to server you can create a json array and convert it to string and send it to server

    @Override
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String, String> params = new HashMap<>();
                params.put("UGUID", UGUID);
                params.put("INAME", list);
                params.put("your_key_d_for_array",yourarray.tostring());
                return params;
            }
    
    0 讨论(0)
提交回复
热议问题