preferences

How to store variables/preferences in Python for later use

混江龙づ霸主 提交于 2020-01-02 02:00:29
问题 I'm working on a program in Python for Windows, and would like to save variables and user preferences so that I can recall them even after the program has been terminated and restarted. Is there an ideal way to do this on Windows machines? Would _winreg and the Windows registry be suited for this task? Or do I need to create some sort of database of my own? 回答1: You're usually going to want to store it in a configuration folder in the "home" folder. That's easy on *nix systems, more difficult

How to refresh Sublime Text 3 workspace color schemes?

蓝咒 提交于 2020-01-01 04:50:13
问题 When you save a project, Sublime Text will create a .sublime-workspace file. In this file, there is an array of buffers, and for each buffer there is a color_scheme property. This is set to whatever color scheme was chosen when the buffers and workspace were created. I recently changed my theme and color scheme in my user settings file. How can I refresh all of my project's workspaces so that way it uses my new color_scheme provided in my user preference file without needed to edit each

Where are Java preferences stored on Mac OS X?

拜拜、爱过 提交于 2019-12-31 10:08:08
问题 On Windows, the Java preferences, which you access in your application from java.util.prefs.Preferences are stored in the registry. Where are those stored on Mac OS X? 回答1: From Apple Developer Connection: The preferences files generated by the Preferences API are named com.apple.java.util.prefs . The user’s preferences file is stored in their home directory ( ~/Library/Preferences/ ). The system preferences are stored in /Library/Preferences/ and are only persisted to disk if the user is an

How can I keep on adding preferences when i click one?

喜夏-厌秋 提交于 2019-12-31 03:58:12
问题 I have a problem. I want to give a user freedom to select a number of Bluetooth devices in my app. Now I dont know how many Bluetooth devices will there be so I was wondering is it possible to give user an option to click on "Add a new Bluetooth Device" custom preference and open up a new preference screen for him to select Bluetooth setting of new device? In summary the display would look like: Add a new Bluetooth Device.. If user adds one, it should then look like: Bluetooth Device 1 Add a

How to edit/reset Alarm Manager?

邮差的信 提交于 2019-12-30 06:46:33
问题 I've set up a Preference Screen in which i have a list preference which allows user to select time interval to notify them. They can choose whether to notify them after every 2,4,8,10 or 12 hours. Here's my list preference: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > <ListPreference android:title="Notification Timer" android:summary="Select when to Notify" android:dialogTitle="Show Notification after every:" android

Show up-Button in actionBar in subscreen preferences

淺唱寂寞╮ 提交于 2019-12-30 03:10:09
问题 I've implemented my preferences like shown in the official guidelines. I have a PreferenceActivity which creates the PreferenceFragment like this: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); if (extras != null) { Bundle bundle = new Bundle(); _widgetID = extras.getInt(GlobalSettings.EXTRA_WIDGET_ID); bundle.putInt(GlobalSettings.EXTRA_WIDGET_ID, _widgetID); WidgetSettingsFragment fragment = new

How to save cropped image uri in shared Preference

时间秒杀一切 提交于 2019-12-25 08:58:03
问题 I have selected an image and cropped it. But I want to save the cropped image uri in shared preference so that it can be showed later. I know how to save in shared preference, but the problem key is "how I can get the image URL of the cropped image" ........................ Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); // code for crop image intent.putExtra("crop", "true"); intent.putExtra("aspectX", 0); intent.putExtra("aspectY", 0);

Share a value across all views of my activity

妖精的绣舞 提交于 2019-12-25 08:29:39
问题 This question is more like a discussion about how you guys would do it. I'm developing an application that has an Avatar Creation, but this creating occurs across two different Activities. In the first one the user selects whether is man or a woman and a name, in the next Activity the user has to select his face, hair, clothes and etc. Since the views for hair and etc changes if the user is a man or a woman how would you implement a way to pass the gender value to all the Views? I was

Android preferences: saving in Activity or PreferenceActivity

巧了我就是萌 提交于 2019-12-25 05:09:45
问题 I have an Activity which when clicking the menu and a button appearing there, goes to a PreferenceActivity , and then loads three ListPreferences . The ListPreference lets the user choose several values to update a remote DB, and I would like that to save those values when the application goes paused for example. As the ListPreference are in the PreferenceActivity , how can I get those values? Where should I save the current preferences state, in the Activity or in the PreferenceActivity ?

won't update from Preferences

左心房为你撑大大i 提交于 2019-12-25 04:21:44
问题 It updates front activity when I edit or just click ok on any input in preferences screen and than i must first hide front activity. It gives me zero on button and in preferences xml i gave right key and also defaultValue. So .. scenario: i go to preferences screen, click to edit button text, just click ok, go back, its "0" on button, hide front activity, go back to front activity and theres is the right value. I hope i included all necessary parts. private SharedPreferences prefs; private