I’d like to make a welcome screen just for 1 time. It should not be a splash screen because I’d put a TextEdit and a button to get the user’s username. I need to see some examples of the code that would do it, thanks for stopping by! 😀
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. First let the user insert his Username in the TextView.
2. When the user press the Button, then do the following…
– Use
Intentto move to the next Activity you want to divert him after this Staring Activiy.Eg:
– Now after you use
startActivity()method withIntentas the argument, do usefinish()method, that will remove this StartActivity from the Back-Stack.Eg:
Now if the user press
back buttonfrom theDesiredActivity( the one you went fromStartActivity), the app will exit.////////////Edited Part/////////////////
You don’t want you app not to go to the First activity again, where you have already given the username.. After the first time..right ??????
– Then to do this… i will recommend you to do the below….
i. First save the username that user inputs the first time into
Shared Preferenceor into afile, or aDatabase.ii. Now when you open you app, let there be a
threadwhich checks the existence of the username in the Shared Preference or in a file, or a Database, resp wherever u have saved it.iii. If found let it move to the desired activity, if not prompt him to input the username, thats what happen the 1st time you open your app.
iv. Now its also about user-friendliness, so i recommend you to use a
splash activityin the beginning, and fire your checking thread from here. So the user wont feel awkward looking at the blank screen while the thread checks the username