Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

clear edittext android

editText.getText().clear();
Comment

clear edittext android


public class Trackfolio extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
    public EditText editText;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        editText = (EditText) findViewById(R.id.editText1);
        editText.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        editText.getText().clear(); //or you can use editText.setText("");
    }
}

Comment

PREVIOUS NEXT
Code Example
Java :: from string to double andoird studio 
Java :: how to get the highest value in a list java 
Java :: -Xlint:deprecation 
Java :: java print stacktrace to file 
Java :: StringBuilder java pop back 
Java :: bundletool aab to apk 
Java :: long to int java 8 
Java :: admost track purchase 
Java :: javaee .jsp get value of object with EL 
Java :: how to make background image transparent in android studio 
Java :: java get specific element from arraylist 
Java :: java swing button on click 
Java :: intent android open activity 
Java :: star pattern in java 
Java :: how to get color from color file in adroid studio 
Java :: how to set audio of a java sound clip 
Java :: access each key and value in a hashmap java 
Java :: int a=08 java 
Java :: java enum get first element 
Java :: spring xml 
Java :: convert string to sql date in java 
Java :: java initialize float to zero 
Java :: how to stop timer in java 
Java :: how does devision works in Java 
Java :: java retirer derniere caractere sting 
Java :: java generic array 
Java :: short java 
Java :: check if jcheckbox is checked java 
Java :: java check data type 
Java :: android studio close app 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =