Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的程序中有一个奇怪的问题。在激活默认值之前,我需要单击首选项菜单。这不好...如何在程序启动时而不是在单击设置菜单时激活首选项默认值?是否可以在不单击首选项菜单的情况下自动加载值?
您可以在 oncreate() 方法中使用它...
VAT_STRING = preferences.getString("TAXVAT", "5");