Actually just started dating. I want to add a value to the text field by clicking on the button and by pressing the second button, clear the field or substitute another value. Now it turns out to only insert a value, the second button does not work, and it does not matter if I pass an empty value or another string.
import android.app.Activity; import android.os.Bundle; import android.widget.Button; import android.widget.EditText; import android.view.View; public class SecondAppActivity extends Activity { private EditText edtext; private EditText butSecond; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); edtext = (EditText)findViewById(R.id.edittext1); butSecond = (EditText)findViewById(R.id.edittext1); } public void BatonClick(View v){ edtext.setText("Пыщ Пыщ"); } public void BatonClick2(View v){ butSecond.setText(""); } }