How to change main activity at application startup in Android?
I want to implement lock screen asking for password, before allow user to interact with application. Password 开发者_运维问答screen can be turned of in application's settings and in such case (when application should not ask for password) I want to start Main application activity not Password activity. How it is possible?
In the onCreate of the Main activity, check preference and if password is on startActivity to load the Password activity.
First, I am new to Android programming so bear with me!
If I was doing it, I would have created another activity that would be the main activity (set in the AndroidManifest.xml file) and inside the onCreate()
event I would have checked that parameter in your setting file and depending on its value, I would have launched the password activity or the other one.
精彩评论