我需要发送arraylist值为:starDateS,endDateS,starHourS,endHourS和intervalS。在参数:fecha1,fecha2,desde,hasta,slotH。一个URL的在URL中发送ArrayList值
private String intervalS [] = new String[30];
private String starHourS [] = new String[30];
private String endHourS [] = new String[30];
private String starDateS [] = new String[30];
private String endDateS [] = new String[30];
IdProf="258";
intervalSelected = (String) adapSpinnerIntervalT.getItem(position);
intervalS [0] = intervalSelected;
starHourSelected = (String) adapSpinnerStarH.getItem(position);
starHourS[0] = starHourSelected;
endHourSelected = (String) adapSpinnerEndH.getItem(position);
endHourS[0] = endHourSelected;
mStarDate = mDpDay + " " + mMonth + "," + mDpYear;
starDateS[0] = mStarDate;
mEndDate = mDpDay + " " + mMonth2 + "," + mDpYear;
endDateS [0] = mEndDate;
ServerConnection.setDataAvailab = “http://www.saludvitale.com/app/disponibilidad?idUser=”;
private void setDataAvaliability (String IdProf, String[] endDateS, String[] starDateS, String[] intervalS, String[] starHourS, String[] endHourS) {
UrlDataAva=ServerConnection.setDataAvaliab+IdProf+"&fecha2="+endDateS[0]+"&fecha1="+starDateS[0]+"&slotH="+intervalS[0]+"&desde="+starHourS[0]+"&hasta="+endHourS[0];
try {
JsonObject objPayload = new JsonObject();
ServerConnection.SendHTTPRequet(getActivity(), UrlDataAva, objPayload, new OnComplete() {
@Override
public void onRequestComplete(Exception e, String result) {
handleDataAva(result);
}
});
}catch (Exception e) {
e.printStackTrace();
}
}
当我这样做是%5B%5D是我的网址参数,添加在前面的一个。
我迷茫......发生什么事VS你希望发生什么? – MaxPower
对不起,发生什么事是它不能将参数识别为数组,因此它不会添加%5B%5D。我想知道如何放置参数,以便在url中添加%5B%5D。 – jeanf