简体   繁体   English

在安装时只显示一次Android屏幕

[英]Showing a android screen only once on installation

I am having an android layout having to input some of the basic details of the user. 我有一个Android布局必须输入用户的一些基本细节。 This layout screen or activity has to come only once after installation, but it should not come up after successive opening of the application. 此布局屏幕或活动必须在安装后才出现一次,但在连续打开应用程序后不应出现。 Could you let me know how can this be achieved in android. 你能让我知道如何在android中实现这一点。 Looking forward to your reply. 期待你的回复。 thanks. 谢谢。

you can put a flag in shared preferences that you showed once the screen and it's no need to show it again. 您可以在屏幕上显示的共享首选项中放置一个标记,而无需再次显示。 But when the user clears data, the flag will be deleted. 但是当用户清除数据时,该标志将被删除。 As a hard way, you can save this flag on a server or cloud. 作为一种困难的方法,您可以将此标志保存在服务器或云上。

I think having a flag set in shared preference is the best way to do that. 我认为在共享偏好中设置标志是最好的方法。 And i think if the user clears his cache , then he deserves to see the screen which is shown only once on installation. 我认为如果用户清除他的缓存,那么他应该看到在安装时只显示一次的屏幕。 Similar is the behaviour which happens everywhere. 类似的是到处发生的行为。 Many websites store the user information in their cache and don't show user unnecessary information but if you clear the cache then you will see that information back again 许多网站将用户信息存储在其缓存中,并且不向用户显示不必要的信息,但如果清除缓存,则会再次看到该信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM