确定是否Android应用程序是使用第一次应用程序、Android

2023-09-11 12:42:17 作者:腾讯认证逗比

我目前正在开发一个Android应用程序。我需要做的,当应用程序启动的第一次,也就是code只能运行在第一次程序启动的东西。

I am currently developing an android app. I need to do something when the app is launched for the first time, i.e. the code only runs on the first time the program is launched.

推荐答案

另一个想法是在共享preferences使用的设置。同样的总体思路是检查一个空文件,但你没有一个空文件左右浮动,而不是被用来存储任何

Another idea is to use a setting in the Shared Preferences. Same general idea as checking for an empty file, but then you don't have an empty file floating around, not being used to store anything

 
精彩推荐
图片推荐