简体   繁体   English

App 1st安装Android时要执行的方法

[英]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.

相关问题 单击第一个项目时,Android CarouselPicker - Android CarouselPicker when 1st item is click 从Android中的第一个应用程序开始第二个应用程序的活动 - Start Activity of 2nd app from 1st app in android Android 通知点击打开应用程序仅第一次有效 - Android notification click to open app only works 1st time 启动活动Android时将焦点放在列表视图中的第一项 - Focus 1st item in a listview when starting an activity android Android - 错误的第一个参数类型和“android.supportv4.app.Fragment” - Android - Wrong 1st argument type and ' android.supportv4.app.Fragment' 获取每月1号的工作日-Android Studio - Get Weekday of 1st of Month - Android Studio Android Studio:2个XML文件,但App正在启动第二个XML文件,而不是第一个 - Android Studio: 2 XML Files, but App is starting 2nd XML-file instead of 1st one 在 android 中将数据从第一个选项卡传递到第三个选项卡活动时获取 null object 引用 - Getting null object reference when passing data from 1st tab to 3rd tab activity in android 使用android中的putextra和getextra方法从第二个活动转到第一个活动时图像视图的可见性消失了 - visibility gone of image view when come from 2nd activity to 1st activity using putextra and getextra method in android Android动画imageview 1st旋转,然后淡出以进行飞溅 - Android animation imageview 1st rotate and then fadeout for splash
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM