Android passing a string to a php file
<p>Here is my java android code which should pass 'Preferred hotels' string to a php file and later read what have been passed.</p>

<pre><code>sendSubMenuDetail("Preferred hotels");
</code></pre>

<p>This is evoked at the activity load. Whose function is below:</p>

<pre><code>    public void sendSubMenuDetail(String suggestion){
    String urlSuffix = "?suggestion="+suggestion;
    class RegisterUser extends AsyncTask&lt;String, Void, String&gt; {

        ProgressDialog loading;

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            loading = ProgressDialog.show(ActivitySubMenu.this, "Please Wait",null, true, true);
        }

        @Override
        protected void onPostExecute(String s) {
            super.onPostExecute(s);
            loading.dismiss();
            Toast.makeText(getBaseContext(),s,Toast.LENGTH_LONG).show();
        }

        @Override
        protected String doInBackground(String... params) {

            String s = params[0];

            BufferedReader bufferedReader = null;
            try {
                URL url = new URL(address+s);

                HttpURLConnection con = (HttpURLConnection) url.openConnection();
                bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream()));

                String result;

                result = bufferedReader.readLine();

                return result;
            }catch(Exception e){
                return null;
            }
        }
    }

    RegisterUser ru = new RegisterUser();
    ru.execute(urlSuffix);
}
</code></pre>

<p>The output dislayed in a toast here is 'Preferred' instead of 'Preferred hotels'. I tried figuring out what the problem might be with no success. </p>