确定是否是首次使用Android应用 [英] Determine if Android app is being used for the first time

查看:67
本文介绍了确定是否是首次使用Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个android应用.首次启动应用程序时,我需要做一些事情,即代码仅在程序首次启动时运行.

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.

推荐答案

另一个想法是使用共享首选项"中的设置.与检查一个空文件相同的基本思想,但是那样您就不会有一个空文件在浮动,不被用于存储任何东西

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

这篇关于确定是否是首次使用Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆