设置按钮永久启用 [英] Setting a button permanently enabled

查看:110
本文介绍了设置按钮永久启用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为阶段1至stage10不同的按钮列表。那么stage1的按钮是唯一启用的按钮,其余的都被禁止。用户完成阶段1里面的所有问题后,会释放阶段2。我怎样才能永久启用设置一个按钮,让每一位用户退出应用程序,然后重新打开时它被设置启用按钮仍然应该启用。

I have a list of different buttons named stage1 to stage10. then the stage1 button is the only button that is enabled and the rest are disabled. after the user finished all the questions inside stage1, it will unlock stage2. How can I permanently set a button enabled so that every time the user exits the application and re open it, the button that is set enabled should still be enabled.

推荐答案

您可以存储有关哪些按钮是在共享preferences启用的信息。一旦你回来,你检查哪个按钮被激活最后一次,并通过程序启用它们。

You could store the information about which buttons were enabled in SharedPreferences. Once you come back you check which buttons were enabled last time and enable them programatically.

这篇关于设置按钮永久启用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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