preferences

What's the proper way to setup an Android PreferenceFragment?

你离开我真会死。 提交于 2021-02-18 21:58:24
问题 I'm trying to implement a basic settings activity in an Android app and either get a blank white screen or a crash. The documentation and samples I've seen aren't helping because they're either old or inconsistent. For example, depending on where you look, the settings activity should either extend Activity, PreferenceActivity, or AppCompatPreferenceActivity (part of the File>New>Activity>Settings Activity). developer.android.com says you should implement the following: public class

How To Retrieve RadioPreference, CheckPreference values in Preferences in Flutter

让人想犯罪 __ 提交于 2021-02-17 05:52:05
问题 I am having a hard time retrieving the user preference in multiple RadioPreference in a flutter project using the Preferences library https://pub.dev/packages/preferences#. I know how to use SharedPreferences in Flutter but after following the example in the preference page, I can't seems to retrieve the actual user selection. For example PreferenceDialogLink( 'Android\'s "ListPreference"', dialog: PreferenceDialog( [ RadioPreference( 'Select me!', 'select_1', 'android_listpref_selected'),

Should I always use the java preferences API get() method or load them into memory and get them from there?

自作多情 提交于 2021-02-08 19:39:45
问题 I'm using java.util.prefs to store application settings and use those settings regularly in the application. Upon application start, should I load those settings into memory so that I'm not constantly retrieving them from the preferences file? I'm asking from the perspective of performance and for standard coding practice. I feel like there's a trade off for performance: If you load them into memory you have quicker access to them but then when you change any settings you have to make the

Should I always use the java preferences API get() method or load them into memory and get them from there?

天涯浪子 提交于 2021-02-08 19:39:03
问题 I'm using java.util.prefs to store application settings and use those settings regularly in the application. Upon application start, should I load those settings into memory so that I'm not constantly retrieving them from the preferences file? I'm asking from the perspective of performance and for standard coding practice. I feel like there's a trade off for performance: If you load them into memory you have quicker access to them but then when you change any settings you have to make the

Android EditTextPreference dialog style/theme

北战南征 提交于 2021-02-07 08:42:57
问题 I'm trying to style the dialog box that appears when I select an EditTextPreference in my SettingsActivity. So far I have been able to change the colour of the two buttons and the background with: dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(0xffffffff); dialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(0xffffffff); dialog.getWindow().setBackgroundDrawableResource(R.drawable.blue_background); But I am so far unable to change the title at the top of the dialog.

Android EditTextPreference dialog style/theme

你说的曾经没有我的故事 提交于 2021-02-07 08:40:54
问题 I'm trying to style the dialog box that appears when I select an EditTextPreference in my SettingsActivity. So far I have been able to change the colour of the two buttons and the background with: dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(0xffffffff); dialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(0xffffffff); dialog.getWindow().setBackgroundDrawableResource(R.drawable.blue_background); But I am so far unable to change the title at the top of the dialog.

Meaning of 'Ignore potential matches'

喜你入骨 提交于 2021-01-27 04:11:42
问题 Under Window > Preferences > General > Search , there is the option Ignore potential matches What does it do? Whether I activate it or not, I never see a difference. Is it an option that only makes sense for Java development (which I never do, but I do develop in C, Python and PHP using Eclipse)? 回答1: See bug 127442 for examples: depending on what you are searching (a class, a method, ...), the Search engine can find instances which could match (but it cannot say for certain). Those instances

Meaning of 'Ignore potential matches'

喜夏-厌秋 提交于 2021-01-27 04:10:07
问题 Under Window > Preferences > General > Search , there is the option Ignore potential matches What does it do? Whether I activate it or not, I never see a difference. Is it an option that only makes sense for Java development (which I never do, but I do develop in C, Python and PHP using Eclipse)? 回答1: See bug 127442 for examples: depending on what you are searching (a class, a method, ...), the Search engine can find instances which could match (but it cannot say for certain). Those instances

android:visibility attribute in preferences xml not working? (Android 2.3)

半腔热情 提交于 2020-12-26 06:04:57
问题 Take for example this small preference.xml file: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen android:title="@string/sig_title" xmlns:android="http://schemas.android.com/apk/res/android"> <ListPreference android:entries="@array/text_display_entries" android:title="@string/sig_style" android:key="text_style" android:entryValues="@array/text_display_values" /> <CheckBoxPreference android:title="@string/custom_font" android:key="tweaks_text" /> <CheckBoxPreference android:title="