アプリで配列リストを複数の文字列に分割して、順番に表示する必要があります..
ArrayList<String> contactlist = new ArrayList<String>();
contactlist.add("Prasad");
contactlist.add("Prasad");
contactlist.add("Prasad");
contactlist.add("Prasad");
String[] contact = new String[contactlist.size()];
contact = contactlist.toArray(contact);
StringBuffer sb = new StringBuffer("");
for (String s : contactlist) {
sb.append(s+",");
}
stringToSend = sb.toString();
Log.d("stringToSend ", stringToSend);
new upload().execute();
/*
* String[] rString = stringToSend.split("-");
*
* for (String s : rString) { System.out.println("Names : " +
* s); }
*/
}
});
}
class upload extends AsyncTask<Void, Void, Void> {
String res, res1, url;
ProgressDialog pd;
protected void onPreExecute() {
pd = ProgressDialog.show(MainActivity.this, "Sending",
"Please Wait");
}
@Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
try {
res = null;
url = "http://192.168.0.40:8092/Testing/Login";
//res = CustomHttpClient.executeHttpGet(url).trim();
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("name", stringToSend));
res = CustomHttpClient.executeHttpPost(url, nameValuePairs);
} catch (Exception e) {
// TODO: handle exception
}
return null;
}
protected void onPostExecute(Void unused) {
pd.dismiss();
if (res != null) {
Toast.makeText(MainActivity.this, "res", 1000).show();
}
}
prasad、prasad、prasad、prasad という応答が返ってきました
私は次のような応答を得る必要があります
プラサード
プラサード
プラサード
プラサード
どうすればいいですか?