简体   繁体   中英

Methods to be performed when app 1st installs android

Hi guys I have been looking around for the answer to this but have come up with nothing, I would like to have an activity that asks the users for their details and then send them details to an external database after they first install the app. Does anyone have any suggestions on how to create an activity that will only be used when the app is launched for the 1st time. Cheers to anyone who can help

Save a flag in shared preferences that you set after completing the activity. You can actually save this flag anywhere, as long as you have it in some sort of persistent storage. Then on load, check in that activity if the flag exists (you can do this in onCreate), if it does, launch an intent to another activity.

Create a file or store a persistent property at the first boot. Check for the existence of that file/property at every boot.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM