由网友(被n1遗漏旳人)分享简介:我要救一个标志认识到我的应用程序运行在第一次与否。对于这个简单的工作,我不想创建数据库。I want to save a flag for recognizing that my app is run for the first time or not. For this simple job I don't wan...
我要救一个标志认识到我的应用程序运行在第一次与否。对于这个简单的工作,我不想创建数据库。
I want to save a flag for recognizing that my app is run for the first time or not. For this simple job I don't want to create database..
有一个简单的选择要做到这一点?我要保存和读取的小条信息只。
Is there a simple option to do this? I want to save and read little pieces of information only.
推荐答案
使用共享preferences
。
SharedPreferences preferences = getSharedPreferences("prefName", MODE_PRIVATE);
SharedPreferences.Editor edit= preferences.edit();
edit.putBoolean("isFirstRun", false);
edit.commit();
相关推荐
最新文章