preferenceactivity

Get the Ringtone title from RingtonePreference

邮差的信 提交于 2021-02-07 04:59:25
问题 I have a RingtonePreference that is used to select a ringtone that is broadcasted to a receiver used in an Alarm application. I would like to display the title (the titles displayed in the list you see when you choose the ringtone) of the selected ringtone in the summary of the RingtonePrefernce. Somehow get the ID3 tag? Some ringtones would be mp3 but not all so this might not be a good idea? What I do now is: SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences

How to add Toolbar in PreferenceActivity

人盡茶涼 提交于 2021-02-07 03:37:50
问题 I have created an app settings with Preferences. But I noticed, that there no toolbar in my PreferenceActivity. How I can add toolbar to my PreferenceActivity? My code: my pref_xml: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <ListPreference android:key="select_class" android:title="@string/select_class" android:defaultValue="0" android:entries="@array/classy" android:entryValues="@array/classy" android:dialogTitle="

How to handle click events on custom items in the preference(PreferenceFragment)?

别说谁变了你拦得住时间么 提交于 2021-01-29 05:06:40
问题 I created custom layout for preference in order to add new custom item to it. I add that layout with android:layout property. My custom layout looks like that: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:gravity="center_vertical" android

PreferenceFragment with transparent background?

风流意气都作罢 提交于 2020-07-06 09:50:39
问题 I have created a PreferenceFragment with two categories and one checkbox, however, when I display it in my app, the background appears to be transparent. I can see the main activities, fields and the PreferenceFragment ones are laid over top of the ones from the main activity...what is the solution to this? In my main activity I am doing this to open the PreferenceFragment when the settings button is selected: @Override public boolean onOptionsItemSelected(MenuItem item) { //handle presses on

PreferenceFragment with transparent background?

冷暖自知 提交于 2020-07-06 09:50:22
问题 I have created a PreferenceFragment with two categories and one checkbox, however, when I display it in my app, the background appears to be transparent. I can see the main activities, fields and the PreferenceFragment ones are laid over top of the ones from the main activity...what is the solution to this? In my main activity I am doing this to open the PreferenceFragment when the settings button is selected: @Override public boolean onOptionsItemSelected(MenuItem item) { //handle presses on

start an other PreferenceScreen through a PreferenceActivity option

时光总嘲笑我的痴心妄想 提交于 2020-01-23 03:29:13
问题 I'm writing a configuration menu with many options and I'd like to add in the main PreferenceScreen an option that can launch an other PreferenceScreen. I can't figure out how to create a generic menu entry (so, nor EditTextPreference nor CheckBoxPreference etc.) Thanks to all. 回答1: Nest your PreferenceScreen elements. The inner PreferenceScreen will hold the contents of the second screen; the title and description you put on the inner PreferenceScreen will be your "generic menu entry". For

Android: Bottom Button Bar in PrefernceActivity?

妖精的绣舞 提交于 2020-01-13 18:14:07
问题 I'd like to create a PreferenceActivity with a button bar at the bottom, should look like the picture on the right. Anyone know how to do this? I came across this: Bottom button bar in android, but it doesn't work in a Preference screen 回答1: You should be able to create your own layout for the PreferenceActivity that contains your button bar. A PreferenceActivity is just a ListActivity , so follow the rules for creating your own layouts for ListActivity . Bear in mind that Android 3.0's

android - showing listView in PreferenceActivity

折月煮酒 提交于 2020-01-03 05:04:50
问题 i wish to show a listView on a PreferenceActivity similar to what the android OS wifi-settings has for the list of networks (example here , on the bottom area of the image) . however , such a thing isn't availabe , so i've created a new class that extends Preference , and what i returned in the onCreateView is just a ListView instance . it worked , but the listView has a constant size of about a single item no matter what i do to its layoutParams and no matter what i do to the adapter . even

Android Livewallpaper settings fail to load from 'configure…' menu

五迷三道 提交于 2020-01-02 16:17:14
问题 I am unable to load the live wallpaper preferences from 'Wallpaper>Configure...'. The preferences load fine when i click the settings button from within the Livewallpaper menu. Here are some screen shots to better explain the error: Error Log The manifest file is as follows: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.RrD" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8"

Android: add buttons to a preference screen

安稳与你 提交于 2020-01-01 19:32:51
问题 The thing is...I want to use PreferenceActivity to add a new row in my custom list view. So my preference ativity will consist of a few EditTextPreferences, my custom TimePickerPreference and a coulpe of ListPreferences... Like this: http://www.google.com/help/hc/images/android/android_ug/168567.5.png . The question is how they added buttons on the bottom? And.. is it possible to use OnClickListener for obtaining inputed values and how? Thanks! 回答1: A PreferenceActivity inherits from