public boolean setContacts(String name, String number) {
serviceUrl = "http://...../sample.php?method=setcontacts";
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("name", name));
nameValuePairs.add(new BasicNameValuePair("num", number));
try {
httpClient = new DefaultHttpClient();
httpPost = new HttpPost(serviceUrl);
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse httpResponse = httpClient.execute(httpPost);
..................
}
在这段代码中,我向服务器发送一行具有名称和号码的行正常工作, 但我想发送一个名称和号码列表,如
ArrayList<Strng[]> contactsList =...............;
所以我如何实现这个
public boolean setContacts(ArrayList<String[]> contactsList) {
}
如果您有其他选择,请提前感谢我。