preference

Naming preference: getSupportedModes() vs supportedModes()?

I'm having hard time deciding which name to choose for my method. I think they both are pretty much self-explanatory, but the latter is faster to type, so, my current preference is supportedModes(). What do you think? ...

Launch Activity from Preference Activity causes Permission Denial Exception

Hi, I'm having a bit of a problem here. What I want to do is launch an Activity from within the PreferenceActivity. So my preference.xml which holds the preference layout looks like this: <Preference android:title="Launch Activity" > <intent android:action="org.momo.SOME_ACTIVITY" /> </Preference> The manifest is aware of the activ...

Read SharedPreferences when you haven't set the name of the file.

When you createa a PreferenceScreen on Android, your application creates a default SharedPreferences file for the settings. I want to read this name, or get a reference without specifing the name. Currently I use: SharedPreferences prefs = ctx.getSharedPreferences("prefs", 0); SharedPreferences.Editor ed=prefs.edit(); But this return...

Objective C - preferred way to create and initialize an object

Is one of these two ways to create and initialize an object preferable? MyClass oClass = [[MyClass alloc] init]; oClass.length = 5; oClass.text = @"Hello"; or using a class method that contains about the same code but looks like this: MyClass oClass = [MyClass initWithLength:(int) 5 andText:(NSString *) @"Hello"]; I hate it when I ...

ListPreference, how can you make it to NOT save to SharedPreference?

I am resuing ListPreference for a setting which I store in the database. I do not want it stored in the preference file. How can I reuse ListPreference in such way that it does NOT save to SharedPreference file? ...

MySQL Order By Symbol Preference

I was wondering if there was a way to make alphanumeric characters have a higher order of preference than symbols when doing an ORDER BY. I.E. 'a' to come before '(' There are many ways round this, but I'd prefer the most elegant db approach. ...

Android - Using PreferenceScreen to display and save settings to/from ContentProvider

I have my own custom Content Provider that loads a database which contains the settings information for my application. I load the settings from the ContentProvider on the creation of my Settings activity. My Settings activity is made up of a PreferenceScreen and Dialog based EditText's. The following code shows how I use the preferen...

eclipse coloring: how to config the background color of folding margin ?

I checked every possible editor coloring options carefully, but the background color of folding margin seems not in the preferences dialog. Is it possible to config this? ...

Adding configChanges ="locale" programatically

I use configChanges="locale" on my activities. Without this options in AndroidManifest.xml in 2.x i get flickering screens. It works in all my activities excepting in the preferences screen i add programatically. I have one Preference Activity --> it works after setting configChanges="locale" to the AndroidManifest.xml. Inside of the P...

How can one create a org.eclipse.jface.preference.BooleanFieldEditor with a multi-line label?

The ff. does not work. "Second line" is rendered on the same line as "First line". What's more is that there is no space between the two. new BooleanFieldEditor("Name", "First line\nSecond line", getFieldEditorParent()); ...

How do I write a combined CheckboxPreference / PreferenceScreen?

I would like to have a checkbox preference that takes the user to a new (sub)preference screen if the user presses on the actual text (and not on the checkbox to the right). Just as the control under Settings -> Wireless -> Mobile Network Settings -> Access Point Names. ...

Getting a Soft Keyboard for a EditTextPreference

Hello, I have a shared preference that is being accesed via an EditTextPreference. I am in the process of porting this application to a device that does not have a hardware keyboard for text entry. When the time comes to modify the EditTextPreference, there is no soft keyboard that becomes available, and I am at a loss as to how to in...

Can I perform database specific operation using android.preference package?

hi, I need a database in which I can store data and get data whenever I need. Is this possible with android.preference package. I do not want to use sqlite database regards ...

Forcing keyboard input on Buttons inside extended Preference

While extending Preference and making your own view by overriding onCreateView(), how can you make widgets inside selectable by keyboard only? For example, let's say that you have two buttons in your preference, upon pressing DPAD_DOWN, for 4 consecutive times, you'd like PreferenceActivity to behave like: 1.) select your preference (fr...

why are programmers so passionate about their tools?

What is it about our profession that breeds such passionate support for our preferred IDE, OS, language, algorithm, licence, etc? Is it the (relatively) nascent stage of the craft so that the winners of the debate can potentially gain a dominant position, or is it a reflection of an innate competitiveness that is less likely to be exerc...

Android: PreferenceActivity: Why is this 'simple' logic check on a stored preference value not evaluating?

Following an example from Professional Android 2 Application Development I set up a pref class as follows: //Preferences.java public class Preferences extends PreferenceActivity{ public static final String PREF_SPEED_UNIT ="PREF_SPEED_UNIT"; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(sa...

Customizing CheckBoxPreference via android:widgetLayout

I have a Preference that enables a sync adapter, and takes a while to actually do its work when toggled. Consequently, when the user clicks the Preference, I spin off an AsyncTask to do the work. In the meantime, I disable the Preference and replace the check box with an indeterminate ProgressBar. I have all of this working via a hack ...

Android how to get specific preference?

I have the following code in my application in res/xml/preferences.xml: <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt; <PreferenceCategory android:title="Wi-Fi settings"> <EditTextPreference android:key="pref_voice_threshold_top" android:title="@string/title_pref_voicetopt...

Loading PreferenceScreen from JAVA

How can we fill PreferenceScreen dynamically (from JAVA). I have one string array. I want all items to be displayed in second preference screen with checkbox. Currently I am having CheckBoxPreferencetags for each item in string array in preferences.xml. Any thoughts on how to do this. ...

How can I set the android preference summary text color?

On my preference screen I have a preference that when clicked opens a color picker dialog. What I would like to do is when the user selects a color, that the text summary of the preference is displayed in that color. I know I can have the summary set up like this, Currently <font color="#ff0000">this color</font> and have it display in...