Android向数据库发送数据变为空白

I have made a php file that posts the data to the db and using the android I should post some text. The problem is, When I submit the text A new data gets added to the database, but it's blank data. No numbers, text, etc ..

this is my code:

    public class mainactivity extends Activity {

        EditText edittext1;
        EditText edittext2;
        EditText edittext3;

        String name;
        String nationality;
        String sex;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            edittext1 = (EditText) findViewById(R.id.editText1);
            edittext2 = (EditText) findViewById(R.id.editText2);
            edittext3 = (EditText) findViewById(R.id.editText3);

            name = edittext1.getText().toString();
            sex = edittext3.getText().toString();
            nationality = edittext3.getText().toString();

        Button done = (Button) findViewById(R.id.button1);
        done.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View arg0) {

                new Thread(new Runnable() {

                    @Override
                    public void run() {

                DefaultHttpClient httpclient= new DefaultHttpClient();
                HttpPost httppost = new HttpPost("http://www.xxx.com/thescript.php");
                Log.e("done 1st","its here");

                try
                {
                    ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
                    nameValuePairs.add(new BasicNameValuePair("name", name));
                    nameValuePairs.add(new BasicNameValuePair("sex", sex));
                    nameValuePairs.add(new BasicNameValuePair("nationality", nationality));

                    httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                    HttpResponse response = httpclient.execute(httppost);
                    Log.e("done", String.valueOf(response));
                }
                catch(Exception e)
                {
                    Log.e("didn't work", "hardluck");
                    e.printStackTrace();
                }

            }
                }).start();
            }
        });

    }


}

logcat

09-24 20:13:50.302: E/done 1st(28390): its here
09-24 20:13:51.442: E/done(28390): org.apache.http.message.BasicHttpResponse@416c1b80

this is my current db,maybe the problem is in it

CREATE TABLE `people` (
  `name` varchar(20) COLLATE latin1_general_ci NOT NULL,
  `sex` varchar(10) COLLATE latin1_general_ci NOT NULL,
  `nationality` varchar(15) COLLATE latin1_general_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

I'm going to assume that your edittext fields are for input and that it's waiting for user input. If that is the case, then you would want to access the value of those text fields in your ClickListener instead of your create method.

I'm referring to this code

 name = edittext1.getText().toString();
 sex = edittext3.getText().toString();
 nationality = edittext3.getText().toString();

Since you are retrieving those values onCreate, the use has not entered anything yet. The user should enter something first, then hit your button and kick off the ClickListener. Thus, you should have the above code in your ClickListener instead.

You define name, sex, nationality in onCreate method (when your textfields are blank), try to do this in your button listener:

        ..........
        name = edittext1.getText().toString();
        sex = edittext3.getText().toString();
        nationality = edittext3.getText().toString();

        ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
        nameValuePairs.add(new BasicNameValuePair("name", name));
        nameValuePairs.add(new BasicNameValuePair("sex", sex));
        nameValuePairs.add(new BasicNameValuePair("nationality", nationality));
        ...........