preferences

Programming preference - use else ifs with multiple return statements?

The code: public String getTemperatureMessage(double temp) { if(temp < 32) return "Freezing"; else if(temp < 60) return "Brr"; else if(temp < 80) return "Comfortable"; else return "Too hot"; } Regarding the code snippet above, the else ifs are technically superfluous and don't change the...

How to do opposite of of preference attribute android:dependency?

Is there XML attribute that does the exact opposite of android:dependency? What I would like the dependent preference to be enabled when the other is NOT checked and disabled when it IS checked. edit: maybe the issue isn't with android:dependency maybe there is an xml attribute that I can add to make the default for that preference di...

Toast in PreferenceActivity is shown late.

I want to show a Toast right after the user clicks on a CheckBoxPreference in my PreferenceActivity. myCheckBox.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Toast.makeText(Prefs.this, "tes...

How do I overlay the preference menuitem in FF4/MacOSX ?

Hello, I'm having problems to define the overlay of preferences menuitem for FF4 beta in MacOSX. It works for previous version of FF and in FF4 for other platforms. Basically want to open my .xul window when the user click in Preferences, but now is opening the FF preferences (The overlay is not working). Any help will be great :) Die...

Get Value of a CheckBoxPreference in an Activity

Hi there, I've got a preferences.xml: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt; <PreferenceCategory android:title="Category"> <CheckBoxPreference android:key = "inputPreferences" android:title = "Title" ...

Settings slider images on iPad?

I've got a settings bundle in my app, with PSSliderSpecifiers in it. What sizes should those images on either side of the slider be for iPad? (I know that for the iPhone, they should be 21 pixels squared, but they are not showing up on the iPad.) Edit: in developer preview of 4.2, my images are back! No mod needed. Weird! ...

Cursor type in Emacs

What do I put in my .emacs file to change the cursor type for all frames to box? ...

Preferences & CheckBoxPreference

The documentation for the PreferenceActivity states "These preferences will automatically save to SharedPreferences as the user interacts with them." That being the case, if I subclass PreferenceActivity, invoke addPreferencesFromResource in onCreate, set some preferences in the UI I would expect that any changes made to my preferences s...

Android ADT Plugin doesn't show up in Eclipse

I'm using Windows 7 and installed the 64 bit version of Eclipse 3.5.2. I then installed the Android ADT plugin, but when I try to configure it in the Windows > Preferences dialog, the Android Plugin doesn't show up in the left pane. Instead I see DDMS. This prevents me from specifying the location of the Android SDK (unless there is a...

How to store user preferences in a web app?

hey everyone i would like to know a good software engineering way to store user preferences in a web app. to clarify further, my app has commands that the user can choose, so i added a button that when some commands are selected, these commands are saved as favorites somewhere on the client's machine, that way if user X logs in at anytim...

Should it be if() or if ()?

When you have line of code with a parenthetical statement, do you include a space before the parenthetical? For example, should it be if() or if () Thanks in advance! ...

about config preferences and js

I wonder if it is possible to get values of certain preferences set in about:config using javascript? Incentive is to get value of preferences set in firefox addon i've created when user lands on addon front end. Basically, I'm trying to identify users landing on FE without asking them to login explicitly. ...

How do I get rid of the Eclipse Find/Replace Bar

For searching a document, I like using the floating Find/Replace window that pops up. Lately, however, hitting command-F pulls up this Find/Replace bar at the bottom of the editor window. I suppose I wouldn't mind it so much, except instead of selecting the text to search it puts the insertion point after whatever I've searched for befor...

Android: Service restart after preferences change

Hello, I have a Service and a PreferenceActivity that allows the user to edit some preferences. I would like to restart the Service once the user is done with the PreferenceActivity. I understand that I can register onChange listeners for individual preference changes, but I do not want to restart the Service as each preference change...

Android Preferences not saving...

I'm trying to create a "what's new" pop-up dialog when users update (or, I guess, install) my app. I have the following bit of logic to check that the last installed version was then compare it to the current version, then save the current version as the "last" version (this is called at the end of the onCreate() of my "first" Activity):...

AIR 2 - Data Persistence?

what is the best way to include data persistence in an AIR 2 application? is it creating your own read/write file with flash.filesystem, or is there a new way with AIR 2? ...

[Android] ListAdapter in preferences ?

Is there a way to use ListAdapter in preferences screen ? or i must use only chekboxpreference, textpreferences, etc.... ...

Android boolean preference problem

I want to have the status of a checkbox be saved into my prefs. I set a listener on the checkbox, and if it is checked I do a prefs.putBoolean("cbstatus", true), and it is it unchecked i do a prefs.putBoolean("cbstatus", false); Trouble is, in my onStart() when I get prefs, my Boolean getcbstatus = prefs.getBoolean("cbstatus", false); ...

Can I let user to multi select some titles in Application Preferences?

Hello. I know I can use PSMultiValueSpecifier to let user to choose a value from a list. But it is a single select. How can I let user to be able to multi choose some values, in Application Preferences? THanks ...

Android: How do I reset/clear application preferences during unit testing?

I want to start with a consistent test environment so I need to reset/clear my preferences. Here's the SetUp for test I have so far. It's not reporting any errors, and my tests pass, but the preferences are not being cleared. I'm testing the "MainMenu" activity, but I temporarily switch to the OptionScreen activity (which extends Andr...