Se connecter

Erase the value of a text field when you click

Erase the value of a text field when you click

Remember the Listener we created for the button previously? Well here it is the same for our text field, but simpler! To erase the pre-set value of the text field when clicking, paste this code just after the instantiation of your variables:

editText1.setOnClickListener(new View.OnClickListener() { 
        public void onClick(View v){
                editText1.setText("");
        }
});

Thanks to him, during a support the text of our field of text will be replaced by « in other words, nothing at all!

TOUT VOIRAjouter une remarque
VOUS
Ajouter votre commentaire

Chercher un cours

Publicité

FREEDOM SUBSTITUTE | 2015-2019

Si vous souhaitez interagir directement avec notre communauté, rendez-vous sur discord :

https://discord.gg/Hm5gEGA

FREEDOM SUBSTITUTE

37 Utilisateurs en ligne