I want, when the user marks a RadioButton , an EditText that has already been started as null, appears, but I do not know how to do this. >
I want, when the user marks a RadioButton , an EditText that has already been started as null, appears, but I do not know how to do this. >
The visibility of a View can be indicated using the JAVA method setVisibility()
or the XML android.visibility
attribute.
In order for your EditText to initialize as invisible do:
In XML
<EditText
android:id="@+id/minhaEditText"
....
....
android:visibility="invisible"
..../>
Or JAVA
In method onCreate()
EditText minhaEditText = (EditText) findViewById(R.id.minhaEditText);
minhaEditText.setVisibility(View.INVISIBLE);
When you want it to be visible again:
minhaEditText.setVisibility(View.VISIBLE);
Do you want EditText to be NULL or have no content written to it? If it is not content, just do something like this:
editText.setText("");
This will cause the EditText content to be left blank.