preferences

Programmatically enabling/disabling screen rotations in Android

主宰稳场 提交于 2019-12-03 11:06:31
I have an app which displays a large amount of text for the user to read. I've found that when reading while lying down, I get annoyed that the screen rotates even though my head and the screen are aligned. I do not want to set this to be permanently in portrait mode, so I think this would preclude an approach of setting the android:screenOrientation="portrait" in the manifest. Ideally, I would like to enable/disable automatic orientation changes via a preference page. What would be my best approach? iandisme I would do this by having my preference page write to the SharedPreferences for my

Java Preferences and Internationalization (i18n)

早过忘川 提交于 2019-12-03 07:24:57
The Java tutorials recommend using the Preferences API over Properties files. Properties files and ResourceBundles are the recommended way to handle Internalization requirements in applications. I am considering using both for a desktop application that will display preferences in a locale specific way. Can anyone point out problems with this approach? Maybe I should just use Properties files period? I am considering using both for a desktop application that will display preferences in a locale specific way. OK, so what you want is translated configuration file in form of: some_translated_key

Using a theme for preferences screen

江枫思渺然 提交于 2019-12-03 05:17:50
问题 I want the change the look of the preferences screen for an app I am working on. On some phones the preferences are very translucent and it is quite difficult to read the preferences scheme, so I am going to change the visuals for it. My question is how can I apply a theme to the preferences scheme? Or failing that, how can I change the text color that show up for the various preferences. In my current version, my preferences layout xml file starts with: <LinearLayout xmlns:android="http:/

android sharedpreferences set value

别等时光非礼了梦想. 提交于 2019-12-03 04:14:11
问题 I have preferences page. It has field 'Show info screen' (as checkbox). I have also info page which also should have checkbox 'Show me again'. As I've understand, I can get value from preferences page via PreferencesManager.getDefaultPreferences(context) ... But how I should set preferences value for the checkbox on info page? I tried to use context.getSharedPreferences(PREF_NAME, 0).edit() , to set value but it doesn't correlate with PreferencesManager's corresponding value. What should I do

How do I create one Preference with an EditTextPreference and a Togglebutton?

笑着哭i 提交于 2019-12-03 02:51:42
问题 What I'm trying to implement is basically and exact replica of the image below (the preferences that I've squared). Pressing anything to the left of the preference should open up a dialog. Pressing the togglebutton will disable/enable whatever I'm setting in this preference. I've been trying for hours now and I've come up empty-handed. How do I implement this in a PreferenceActivity? EDIT: It seems people are misunderstanding my question. It is very important that I figure out how to solve my

saving eclipse perspective layout and other things

你。 提交于 2019-12-03 02:22:16
问题 every time I throw away my .metadata (due to some corruption or something) and start with a new one, first thing I do is: Import my saved preferences Load existing projects from disk BUT there are still some things I must configure manually in order to have my setup as I have before, specially in my case (there are probably other things): I have to add the Perspectives I use and remove the ones I don't I have to configure the layout of those Perspectives (specially java one, to use properly

View an Android App's shared preferences?

心已入冬 提交于 2019-12-03 01:45:03
When I am working on my app in eclipse, is there a way to see the changes I make to the shared preferences of the app while it is debugging in the emulator? Thanks in advance R4j Run project in emulator, then from Eclipse choose menu Windows-> open perspective ->DDMS. From tab device, choose emulator name, then go to file explorer,expand data->data->yourpackagename, you should see share reference xml file ( only work on the emulator or a rooted device ). Finally, export this file to windows. See http://developer.android.com/tools/debugging/ddms.html Update : Another way, you can listen shared

Where are Java preferences stored on Mac OS X?

房东的猫 提交于 2019-12-02 20:02:06
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? 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 administrator. avernet Also, note that if the preference is nested enough, it won't directly be in com

android sharedpreferences set value

耗尽温柔 提交于 2019-12-02 16:37:57
I have preferences page. It has field 'Show info screen' (as checkbox). I have also info page which also should have checkbox 'Show me again'. As I've understand, I can get value from preferences page via PreferencesManager.getDefaultPreferences(context) ... But how I should set preferences value for the checkbox on info page? I tried to use context.getSharedPreferences(PREF_NAME, 0).edit() , to set value but it doesn't correlate with PreferencesManager's corresponding value. What should I do??? F1 It depends on whether you are after one set of preferences for your application, or one set per

How do I create one Preference with an EditTextPreference and a Togglebutton?

≡放荡痞女 提交于 2019-12-02 16:25:14
What I'm trying to implement is basically and exact replica of the image below (the preferences that I've squared). Pressing anything to the left of the preference should open up a dialog. Pressing the togglebutton will disable/enable whatever I'm setting in this preference. I've been trying for hours now and I've come up empty-handed. How do I implement this in a PreferenceActivity? EDIT: It seems people are misunderstanding my question. It is very important that I figure out how to solve my problem using a PreferenceActivity. NOT an Activity. I don't care whether I need to do it in XML or