Password authentication every time the application is opened
I created an application but I want to add a password authentication every tim开发者_运维问答e the user open it. When it's the first time to open the application, the user must first input a password and the application should have a settings for changing the password. Does anyone can suggest me how to do this? Thanks
Look into android preferences and store a boolean that indicates whether the application has ever been launched. Then have the first activity in your program check that value, if it is true (first launch), launch an intent for your sign up activity, if it is false (user has used the program, thus, a password should have been set) launch an intent for a user sign in activity.
As far as changing the password, I would have another activity for doing so, which can be launched from anywhere you feel is applicable.
精彩评论