I am using this code, but it catches an error in a try-catch. Where is a mistake?
When I print a error, content.setText(ex.getMessage()); is empty.
Here is the relevant code:
public class MainActivity extends Activity {
    TextView content;
    EditText fname, email;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        content = (TextView) findViewById(R.id.content);
        Button saveme = (Button) findViewById(R.id.save);
        saveme.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(getBaseContext(), "Please wait, connecting to server.", Toast.LENGTH_LONG).show();
                try {
                    String loginValue = URLEncoder.encode("ffa", "UTF-8");
                    String fnameValue = URLEncoder.encode("fdsfdb", "UTF-8");
                    HttpClient Client = new DefaultHttpClient();
                    String URL = "http://mysite/app.php?a=" + loginValue + "&b=" + fnameValue;
                    try {
                        String SetServerString;
                        HttpGet httpget = new HttpGet(URL);
                        ResponseHandler<String> responseHandler = new BasicResponseHandler();
                        SetServerString = Client.execute(httpget, responseHandler);
                        content.setText(SetServerString);
                    } catch (Exception ex) {
                        content.setText(ex.getMessage());
                    }
                } catch (UnsupportedEncodingException ex) {
                    content.setText(ex.getMessage());
                }
            }
        });
    }
}
 
     
     
    