preferences

Eclipse: OSGI Preferences vs. PreferenceStore

﹥>﹥吖頭↗ 提交于 2019-11-30 15:04:22
问题 I'm working on an Eclipse plugin (or in fact, a plugin for an Eclipse-based application) which needs some configuration to be entered by the user. From looking at the documentation, there seem to be two preference APIs - one in org.eclipse.core.runtime.preferences, extending/implementing the OSGI prefererence API, another one, JFace specific, in org.eclipse.jface.preference. Then we have org.eclipse.ui.preferences, too. The OSGI API has a hierarchic Node tree - a preference node ( Preferences

Eclipse: OSGI Preferences vs. PreferenceStore

扶醉桌前 提交于 2019-11-30 12:47:51
I'm working on an Eclipse plugin (or in fact, a plugin for an Eclipse-based application) which needs some configuration to be entered by the user. From looking at the documentation, there seem to be two preference APIs - one in org.eclipse.core.runtime.preferences , extending/implementing the OSGI prefererence API , another one, JFace specific, in org.eclipse.jface.preference . Then we have org.eclipse.ui.preferences , too. The OSGI API has a hierarchic Node tree - a preference node ( Preferences or IEclipsePreferences ) can have multiple subnodes, which themselves can contain both individual

about config preferences and js

夙愿已清 提交于 2019-11-30 12:47:05
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. Yes, you can. First, you need to know that Mozilla uses the XPCOM interfaces for the preferences system. Three used interfaces are nsIPrefService , nsIPrefBranch and nsIPrefBranch2 . The preferences service is instantiated in the same way you instantiate any XPCOM service . Two examples to

Nested preferences.xml

痴心易碎 提交于 2019-11-30 10:56:55
问题 Is it somehow possible to include one preferences.xml into another, like it can be done for layouts with the <include /> tag? Let's say: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen android:title="@string/pref_group_title_visual"> <include preferences_filename="xml/pref_visual"/> </PreferenceScreen> ... 回答1: Solution here it is to inflate both preference files from PreferencesActivity. For example:

Android Keep Screen On In App

老子叫甜甜 提交于 2019-11-30 09:35:26
问题 I have an android app which runs a foreground service and while that service is running I would like to give the user the option to keep the screen on. I added to my settings preferences, a checkbox preference and if true, I would like to keep the screen on but have it set to off by default. It's just something my users have asked for. Currently i have the preference on but when I run the service my screen still shuts of here is what I've done global variable private static final String PREFS

How to clear old preferences when updating Android app?

元气小坏坏 提交于 2019-11-30 08:30:17
I have an app on the Google Play market. For various reasons that I won't bother going into, I have changed the type of some of my preferences. For example a preference type was an Integer and in the most recent version it is now a String. I imagine this isn't good practice but unfortunately I had to do it. My concern is that when someone updates to the new version their app will crash as the preference types have changed. For this reason I would like to clear the preferences whenever the app is updated (again I realise not ideal!) Is this possible? Balázs Édes The SharedPreferences.Editor

Process the value of preference before save in Android?

一世执手 提交于 2019-11-30 05:17:55
I need to crypt my password before save it to local android database. Everything work fine without encryption, I have preferences.xml and so. How can I call a function after I change value of preference (for example, password) ? Here is my code: public class Preferences extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); // Get the custom preference Preference customPref = (Preference) findPreference("pass"); customPref.setOnPreferenceChangeListener(new

Get preferences in AppWidget Provider

两盒软妹~` 提交于 2019-11-30 04:02:48
I seem to be having trouble reading preferences from my AppWidgetProvider class. My code works in an Activity, but it does not in an AppWidgetProvider. Here is the code I am using to read back a boolean: SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); boolean autoreplyon = settings.getBoolean("autoreplyon", false); However, I get the "The method getSharedPreferences(String, int) is undefined for the type widget" error (widget is the name of my AppWidgetProvider class). Thanks in advance for any suggestions! getSharedPreferences() , should you choose to use it, is only

Extras on Email Intent - Preferences XML

半腔热情 提交于 2019-11-30 03:53:20
问题 I'm wanting to trigger an Email from my xml preferences screen and also attach a pre-defined subject and start the cursor in the Body field of the email application Here's what I've got so far <Preference android:title="Support" android:summary="Having a problem?"> <intent android:action="android.intent.action.VIEW" android:data="mailto:support@xxxxx.com" /> </Preference> Works great for triggering the email intent, but how would i go about accomplishing the others via xml? attaching the

ListPreference dependency

余生长醉 提交于 2019-11-30 00:01:29
I have a ListPreference which look something like this: <ListPreference android:title="Choose item" android:summary="..." android:key="itemList" android:defaultValue="item1" android:entries="@array/items" android:entryValues="@array/itemValues" /> Then, I have another preference which should only be enabled if "item3" is selected in the ListPreference . Can I somehow accomplish this with android:dependency ? Something like android:dependency="itemList:item3" Thanks! The only way you can do something like this is programmaticly. You'd have to set up an change listener on the ListPreference and