Question: I would like to get the value of edittext after the user ends typing. So the default is, the edittext is empty. It has no value in it. After the user inputs a value, it should get it.

This is what I've tried:

```
     etQuantity.addTextChangedListener(new TextWatcher() {
        @Override
        public void afterTextChanged(Editable s) {
            // TODO Auto-generated method stub

            Log.d("Quantity", s_quantity);

                int i_quantity = Integer.parseInt(s_quantity);
                int i_grossAmount = i_quantity * i_sellingPrice;
                etGrossAmount.setText(String.valueOf(i_grossAmount));
                Log.d("Gross Amount", "" + String.valueOf(i_grossAmount));

        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            // TODO Auto-generated method stub
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            // TODO Auto-generated method stub

        }     
    });

```

But it doesn't get the correct value I input. Any ideas? Help is much appreciated. Thanks.

Answer: 
its a quick work try it out hope it helps

```
EditText text = (EditText)findViewById(R.id.editText1);
text.addTextChangedListener(new TextWatcher() {

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            // TODO Auto-generated method stub
            System.out.println("ONtext changed " + new String(s.toString()));
        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count,
                int after) {
            // TODO Auto-generated method stub
            System.out.println("beforeTextChanged " + new String(s.toString()));
        }

        @Override
        public void afterTextChanged(Editable s) {
            // TODO Auto-generated method stub
            System.out.println("afterTextChanged " + new String(s.toString()));
        }
    });

```
```
final EditText et = (EditText)findViewById(R.id.editText1);
        et.addTextChangedListener(new TextWatcher() {

            @SuppressLint("ShowToast")
            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                // TODO Auto-generated method stub
                Toast.makeText(MainActivity.this, "" + et.getText().toString(), 2000).show();

            }

            @Override
            public void beforeTextChanged(CharSequence s, int start, int count,
                    int after) {
                // TODO Auto-generated method stub

            }

            @Override
            public void afterTextChanged(Editable s) {
                // TODO Auto-generated method stub

            }
        });

```

Try this code...