Android到PHP,空$ _POST数据

I am trying to send data to a PHP server with BufferedWriter through an android app.

On the PHP side, nothing is displayed. I receive data from the PHP server, but the problem is when I send the data.

Here's the Java code:

public class JsonTaskPost extends AsyncTask<String, String, String>
{
    protected void onPreExecute() {
        super.onPreExecute();
    }

    protected String doInBackground(String... params)
    {


        HttpURLConnection connection = null;
        BufferedReader reader = null;
        BufferedWriter writer = null;

        try {
            URL url = new URL(params[0]);
            connection = (HttpURLConnection) url.openConnection();
            connection.setDoOutput(true);
            connection.setDoInput(true);
            connection.setRequestProperty("Accept-Charset", "UTF-8");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
            //connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
            //connection.setRequestProperty("Accept", "application/json");

            connection.setRequestMethod("POST");

            forum_name = getIntent().getStringExtra(EXTRA_MESSAGE);

            String data = URLEncoder.encode("forum_name", "UTF-8") + "=" + URLEncoder.encode(forum_name, "UTF-8");
            //JSONObject data   = new JSONObject();
            //data.put("forum_name",forum_name);

            OutputStream outStream = connection.getOutputStream();
            writer= new BufferedWriter(new OutputStreamWriter(outStream));
            writer.write(data);
            connection.connect();


            InputStream inStream = connection.getInputStream();
            reader = new BufferedReader(new InputStreamReader(inStream));

            StringBuffer buffer = new StringBuffer();
            String line = "";

            while ((line = reader.readLine()) != null) {
                buffer.append(line + "
");
                Log.d("Response: ", "> " + line); 
            }
            return buffer.toString();

        }
        //catch (org.json.JSONException e){
           // e.printStackTrace();
        //}
        catch (MalformedURLException e) {
            e.printStackTrace();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        finally
        {
            if (connection != null) {
                connection.disconnect();
            }
            try {
                if (reader != null) {
                    reader.close();
                }
                if (writer != null) {
                    reader.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    @Override
    protected void onPostExecute(String result)
    {
        super.onPostExecute(result);
    }
}

PHP code has been simplified to a few lines:

<?php
include_once("config2.php");
include_once("connect.php");
echo($_POST);
?>

Connection is OK because I receive data. The response I receive in android logcat is:

Notice: Array to string conversion in C:\xampp\htdocs\phpBB\android_api\fetch_topics.php on line 6

I get an empty array. I have also tried sending data in JSON format.