开发者

android - how to prefill Edittext?

开发者 https://www.devze.com 2023-03-28 15:46 出处:网络
I have an app where I am storing开发者_如何学运维 the usernames. Once the user clicks on his username, it goes to the login screen. Can it be done that the username be already inputted in the login sc

I have an app where I am storing开发者_如何学运维 the usernames. Once the user clicks on his username, it goes to the login screen. Can it be done that the username be already inputted in the login screen. , so that the user only has to enter his password? Any help would be appreciated. Thanks!


Use the setText() function.


you can use following code in xml:

android:text="<your text here>"

or

android:hint="<your text here>"

but there is more difference between those to android:text and android:hint, first one sets the text and second one will display untill any text entered.

0

精彩评论

暂无评论...
验证码 换一张
取 消