Because you are calling this line
new Read().execute("displayprice");
in onCreate
Where as txt value is changing when you click on button.
So you are accessing txt
value before assigning it. if you want to use the value change like this and try like this
public void onClick(View arg0) {
et=(EditText)findViewById(R.id.text);
txt=et.getText().toString();
new Read().execute("displayprice");
}
});