java - how pass an array in parameters in volley library -


have servers template recives information

['param_id' => 12, 'count' => 4, 'car' => ['mazda 3 bk', '1.6', '2010']] 

list

 list.add(ed_car.gettext().tostring());                             list.add(ed_motor.gettext().tostring());                             list.add(ed_year.gettext().tostring()); 

volley passing

@override                     protected map<string, string> getparams() throws authfailureerror {                         map<string, string> parameters = new hashmap<string, string>();                         parameters.put("param_id", id_item);                         parameters.put("count", spinner_count.getselecteditem().tostring());                          for(int i=0; < list.size(); i++)                         {                             parameters.put("car",list.get(i));///////???                         }                         return parameters;                     } 

how correctly pass list according places in receiving template

use this:

for (int = 0; < list.size(); i++) {     parameters.put("car["+i+"]", list.get(i)); } 

Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -