preferences

Working with Windows registry using java.util.prefs.Preferences

戏子无情 提交于 2019-12-04 19:26:04
I have some questions about the registry. We have Preferences p = Preferences.userRoot(); If we execute p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft") it will return true. After it: p = p.node("/HKEY_CURRENT_USER/Software/Policies"); for(String s : p.childrenNames()){ System.out.println(">" + s); } We see that it has one child: "Windows". But p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft/Windows") returns false. Why? Thanks. UPDATE Ok. I have some mistakes. Let me try again: Why does p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft/Windows") return

Is this a known issue in firefox extensions on Mac OS?

女生的网名这么多〃 提交于 2019-12-04 19:04:36
I've developed a firefox extension which contains a small dialog defined by this XUL script: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow id="firenowPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Fire.Now" ondialogaccept='onSave();' onload="checkFields();"> <script type="application/x-javascript">function onSave(){ alert('blablabla');}</script> <prefpane id="pane1"> <grid> <rows> <row align="center"><label control="username">Username</label><textbox id="username"/></row> <row align=

Programmatically enabling/disabling screen rotations in Android

家住魔仙堡 提交于 2019-12-04 18:40:13
问题 I have an app which displays a large amount of text for the user to read. I've found that when reading while lying down, I get annoyed that the screen rotates even though my head and the screen are aligned. I do not want to set this to be permanently in portrait mode, so I think this would preclude an approach of setting the android:screenOrientation="portrait" in the manifest. Ideally, I would like to enable/disable automatic orientation changes via a preference page. What would be my best

How to reschedule Alarm Manager on Preference Change

淺唱寂寞╮ 提交于 2019-12-04 13:38:54
I have an Android Service. When a phone boots up, a broadcast receiver receives a notification and it schedules the service to run repeatedly at a gap of X minutes. Henceforth After every X minutes another broadcast receiver gets those notifications and kicks the service off, which does it's job and quits. So far so good. Now I want those X minutes to be configurable. I have a perf.xml similar to what is given at the link below. This XML captures all my preferences along with that of service timer. http://android-journey.blogspot.com/2010/01/for-almost-any-application-we-need-to.html Now when

Showing preference screen first time app is run and related questions

荒凉一梦 提交于 2019-12-04 09:34:58
问题 I have an app with 2 activities, the preference and the main activity, I need the preference screen to show first time the app is run so the user can do some configuration. I have checked through the answers on this topic and they don't seem very clear but I gather it has to do with checking that there are sharedpreference file is empty. Can someone please give me a code to sort this out and on which activity would I put the code? Also I am still in the developing stage so I already have my

How to configure java.util.logging.logger in android to use a logging properties file placed on the sdcard?

喜夏-厌秋 提交于 2019-12-04 07:43:52
I have been trying to use java.util.logging.logger to log stuff on to a file on sdcard. Now, I want the logger to use a logging configuration/properties file that I will provide on the sdcard. One way that I have been trying is:- I have been trying to use logmanager and java.util.prefs.preferences, but I get the BackingStoreException-->AccessPermission Exception perculating down to an error message that .java/.userprefs/path represented by str/prefs.xml was not found. private void setLoggingProperties(File logProperties) throws Exception { try { if(logProperties!=null && logProperties.isFile()

Android: Scrollable preferences window with custom list view

岁酱吖の 提交于 2019-12-04 05:35:51
问题 I have an activity with a listview that gets populated with preferences from an xml file, then another listview that gets populated by data in my database, then a textview and a edittext. I want every element (including all the list views) on the screen to take their full height, and the entire screen be scrollable, but I cannot figure out how to do this! Below is my xml: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="

Algorithm for preference based grouping

杀马特。学长 韩版系。学妹 提交于 2019-12-04 04:52:22
I am looking to figure out a way to sort people into classes by preference. For example, say there are 100 students that are each going to be assigned one of five classes: Science - 40 seats Math - 15 seats History - 15 seats Computers - 20 seats Writing - 10 seats Each student has three preferred classes that are ordered by preference. What is the best way to approach dividing up the students so that as many people get their first and second choice classes as possible, while at the same time making sure that no class has too many students for the room. I've thought about approaching it by the

iPhone and NSUserDefaults

北城余情 提交于 2019-12-03 22:19:24
问题 In my viewWillLoad: method I'm currently doing something along these lines: - (void)viewWillAppear:(BOOL)animated { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if ( [defaults boolForKey:@"enabled_preference"] ) { ... } else { ... } [super viewWillAppear:animated]; } If I build and run the application before opening the preference pane (built using a normal Settings.bundle ) then the bool seems to be NO (or more probably nil ) rather than the default YES . However if I

Android custom Preference title size comes out incorrect on some devices. What is the right place to pick it up?

拈花ヽ惹草 提交于 2019-12-03 21:33:39
This problem turned out to be much more tricky than it first appeared as it wasn't a problem on all but a few devices. When creating a custom Preference by making it a subclass of Preference and also use a custom layout defined in an XML file in res/layout and use that layout in onCreateView() in the custom Preference it seems you completely loose the layout information the Preference-s normally have. Nothing strange with that, but if you still want a title (together with the new stuff), how do you specify the size of that title if you want it to be the same size as for other preferences? I