I have this code
private class PostContacts extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(TableMenuActivity.this);
pDialog.setMessage("Odesílám objednávku...");
pDialog.setCancelable(false);
pDialog.show();
}
@Override
protected Void doInBackground(Void... arg0) {
try {
JSONArray polozky = new JSONArray();
try {
JSONArray polozky = new JSONArray();
for (int i = 0; i < rekapitulaceArray.size(); i++) {
JSONObject polozka = new JSONObject();
polozka.put("name", "jmeno");
polozka.put("name", rekapitulaceArray.get(i));
polozky.put(polozka);
}
}
This will generate an array from ListView
, depending on items selected. I want to send them to server. I have tried everything and this is the last thing I need for a school assignment, but I'm unable to get it to work.
If you could write me a code with a simple explanation and also a script to server which will accept the data, I would appreciate it.