Android uses SharedPreferences to complete the function of remembering account and password

design sketch:

After remembering the password, the account password will appear when you log in again, otherwise there is no password.

analysis:

SharedPreferences stores data in a local configuration file

SharedPreferences records Check@R_ 93_ 2419 @ status, if Check@R_ 93_ 2419 @ if selected, the account and password information recorded in the configuration file will be fed back to the account and password control, otherwise it will be cleared.

How to use SharedPreferences:

1. Create a configuration file named config and private

2. Add editor

3. Write data to memory

4. Submit to local

code:

fry.Activity01

/Remember the account and password / RES / layout / activity01.xml

summary

The above is what Xiaobian introduced to you. In Android, SharedPreferences is used to complete the function of remembering account and password. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>