I have a TextView which contains 'F' or 'M', based on user selection. So in my activity I should have to assign a url path relatively to the letter in this TextView. I have created two static strings like so:
private static final String urlman = "http://www.example.com/man.php";
private static final String urlwoman = "http://www.example.com/woman.php";
Then I've created this control point:
private void controlsexuser() {
String sexuser = sexController.getText().toString();
sexController.setText(sexuser);
if (sexuser.trim().equals("F")) {
String sceltaServizio = urlwoman;
}else {
String sceltaServizio = urlman;
}
}
Then in AsyncTask, I've tried to put the new string:
DefaultHttpClient httpclient = new DefaultHttpClient(new BasicHttpParams());
HttpPost httppost = new HttpPost(sceltaServizio);
Unfortunately, the app stops and I don't know why. Any suggestions would be apreciated! Thanks
sceltaServiziois nullcontrolsexuser()is the code you are running, the some you posted, there is not way thatsceltaServiziois not null in yourAsyncTask