[英]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.
然后在加载时,检查该活动中是否存在该标志(可以在onCreate中执行此操作),如果存在,则启动对另一个活动的意图。
Create a file or store a persistent property at the first boot. 在第一次启动时创建文件或存储持久属性。 Check for the existence of that file/property at every boot.
每次启动时检查该文件/属性是否存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.