显示首次条款和条件在Android应用 [英] Showing Terms and Conditions for first time in an android app

查看:213
本文介绍了显示首次条款和条件在Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Android应用程序,其中第一个屏幕是闪屏。如果用户是第一次使用(即该应用刚安装),我必须表明的条款和条件
否则,我必须拿出登录屏幕。

I am developing an android app in which the first screen is the splash screen. If the user is a first time user(meaning the app was just installed) I have to show the terms and conditions otherwise I have to show the login screen.

如何获得的次应用被打开的数量或该应用被打开用于第一时间的指示?是否有任何 API 呢?

How to get the number of times the application was opened or an indication that the app is opened for the first time? Is there any API for it?

推荐答案

您不需要有这样的计数器:

You don't need to have this counter:

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if(!prefs.getBoolean(KEY_EULA_ACCEPTED, false)) {
    showEula();
    // Determine if EULA was accepted this time
    prefs.edit().putBoolean(KEY_EULA_ACCEPTED, true).commit();
}

这篇关于显示首次条款和条件在Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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