enter code here
this is my source code to send the request id to my server link. when i send request to single friend this will show id but when i send the request to multiple friends even then it shows single requestid, Thanks in advance. please help me.
enter code here
package com.ballerxtreme;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.os.AsyncTask;
import android.util.Log;
public class Send_request_id extends AsyncTask<String, String, JSONObject> {
Activity activity;
String request_id;
String json_send;
JSONParser jp = new JSONParser();
public Send_request_id(Activity activity, String request_id)
{
this.activity = activity;
this.request_id = request_id;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected JSONObject doInBackground(String... params) {
// String url = "http://jstarfitness.com/service/saveuser.php";
String url = "http://www.jstarfitness.com/service/requestweb.php";
ProcessingHTTPPostServices parser = new ProcessingHTTPPostServices();
List<NameValuePair> param = new ArrayList<NameValuePair>();
param.add(new BasicNameValuePair("requestid", request_id));
json_send = parser.makeHttpRequest(url, "post", param);
JSONObject jobj = null;
try {
jobj = new JSONObject(json_send);
} catch (JSONException e) {
e.printStackTrace();
String io = e.getMessage();
Log.e("error", io);
}
return jobj;
}
@Override
protected void onPostExecute(JSONObject result) {
Log.e("Id_Send", json_send);
super.onPostExecute(result);
}
}
0 comments:
Post a Comment