受限配置文件的设置不会被记住 [英] Restricted profiles settings not being remembered
问题描述
我按照 http://www.youtube.com/watch?v=pdUcANNm72o一>和我的应用程序设置的设置。
I have followed http://www.youtube.com/watch?v=pdUcANNm72o and set up settings for my app.
我有出现10布尔。这可以在被称为简档设置和时间。
I have 10 Booleans that appear. This can be set and when in the profile called.
不过他们没有选中/取消选中那么主人就返回到设置,他们已经恢复到默认值。
However they are not ticked/unticked then the owner goes back into the settings, they have reverted back to default.
1 /是为了知道哪些用户有哪些已选定的设置还是我的意思打勾或GetRestrictionsReceiver未勾选系统。如果我是,我怎么打算看到每个用户设置为
1/ Is the system meant to know which user has which settings already selected or am I meant to tick or un tick in the GetRestrictionsReceiver. If I am, how am I meant to see each users settings as the
Bundle restrictionsBundle = ((UserManager) getSystemService(Context.USER_SERVICE)).getApplicationRestrictions(getPackageName());
restrictionsBundle.getBoolean("....
是当用户登录了!?
is for when the user is logged on!?
2 /这是一个错误?
2/ Is this a bug?
先谢谢了。
推荐答案
原来,你需要生成RestrictionEntry时添加一些code
Turns out that you need to add some code when generating the RestrictionEntry
虽然我会更新,使人们不必打猎...
Though I will update so that people don't have to hunt...
在您电话接收
final Bundle oldRestrictions = intent.getBundleExtra(Intent.EXTRA_RESTRICTIONS_BUNDLE);
然后创建条目时引用它。
then when creating the entry reference it.
例如
RestrictionEntry myEntry = new RestrictionEntry(KEY, oldRestrictions.getBoolean(KEY, false));
myEntry.setType(RestrictionEntry.TYPE_BOOLEAN);
myEntry.setTitle("KEY TITLE");
newEntries.add(myEntry);
这篇关于受限配置文件的设置不会被记住的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!