preferenceactivity

How to load the same screen preference in the detail PreferenceFragment

核能气质少年 提交于 2019-12-10 04:21:27
问题 I am trying to do something like the settings preferences in android for tablet. When I click the "More" the the "Wireless & Networks" preferences screen is displayed on the right fragment, than if I touch the "VPN" , in the same fragment the "VPN" preferences screen is opened. How can I do that ? this is my preference xml <PreferenceScreen android:title="Title A"> <PreferenceScreen android:title="TITLE B"> <PreferenceCategory android:title="category"> <ListPreference android:key="list"

Start activity from preference-headers

旧街凉风 提交于 2019-12-09 03:05:09
问题 I'm implementing n-layer PreferenceActivities 1st layer PreferenceActivity is loaded from preference-headers. First header creates fragment of settings which is a PreferenceFragment. Second is a browser activity (2nd is an example from developer.android.com) which opens specified Url. The third one I want to be a next level of PreferenceAtivity that also will be loaded from preference-headers. First two work fine but 3rd is crashing an app with the exception: "android.content

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

杀马特。学长 韩版系。学妹 提交于 2019-12-08 14:20:25
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" /> <uses-feature android:name="android.software.live_wallpaper" /> <uses-permission android:name=

Empty PreferenceActivity though a PreferenceFragment was added

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 11:17:11
问题 I'm stuck with a pretty simple issue: I'm trying to build a Preference screen in my app and I'd like to do it with the new, now-standard PreferenceFragment method. This is my prefs xml: <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:title="@string/prefs_interface_settings"> <SwitchPreference android:key="show_average" android:title="Show average length of work day" android:defaultValue="false" android:summary="Display the calculated

TabActivity with ActivityGroup and PreferenceActivity child

心不动则不痛 提交于 2019-12-08 03:25:44
问题 I have a TabActivity where each tab has ActivityGroup. On the home ActivityChild of the first group I have an menu option, which gives to the user the option to open preferences. When I click "Preferences" on menu, I start PreferenceActivity inside ActivityGroup, which shows PreferenceActivity on the first tab. The problem is when I click on any specific preference which has to show a Dialog (for EditTextPreference). I have the following exception: android.view.WindowManager$BadTokenException

Android Preferenceactivity getView

前提是你 提交于 2019-12-07 18:18:31
问题 I have such piece of code :) And i want to edit text property of my custom preference layout. But any changes made on object from getView function does not affect actual list in preference screen. any ideas? I know that i cant extend PreferenceScreen, and i cant use any other type of preference in this case, i only want to be able to edit my custom textview from my layout in code. PreferenceScreen settings = getPreferenceManager().createPreferenceScreen(this); settings.setLayoutResource(R

EditTextPreference.setText(value) not updating as expected

允我心安 提交于 2019-12-07 17:33:41
问题 I'm trying to prevent the user from entering an empty string into an EditTextPreference (in the example, catName ). I use a OnPreferenceChangeListener to detect when a change is made to the EditTextPreference , and if there is a change and the string is blank, I use the EditTextPreference.setText() command to reset to the old value. However, the new value doesn't show up properly if I reopen the EditTextPreference in the GUI (the string is blank), and if I go back into the main app, I can

Is possible to change the summary of EditTextPreference dynamically in Android?

隐身守侯 提交于 2019-12-07 07:32:51
问题 I set up a preferenceScreen to edit the settings in my application. I would like to insert an EditTextPreference that contains a Title like "set your name" and a summary containing the name entered. Is that possible? thank you in advance! 回答1: Sure, here is a short example: EditTextPreference etp = (EditTextPreference) findPreference("the_pref_key"); etp.setSummary("New summary"); This requires that you display your preferences either from a PreferenceActivity or from a PreferenceFragment ,

自定义带有图片的PreferenceActivity

痞子三分冷 提交于 2019-12-06 18:51:17
次和大家分享一下关于 android 中 PreferenceActivity 使用以及为配置信息文件中添加图标的功能,首先给大家看一下效果图: 大家可以看到这是最终的效果图, android 提供了很大的空间供开发者可以自行定义控件,你想让你的控件长成什么样子,你就可以让它长成什么样子。自己也很推崇这类开发思想,因为自行定义控件(前提:系统内置的控件满足不了自己的需求)的优点不言而喻。这边主要分享两种类型: 1: 单纯标题类型; 2: 带有复选框。 先和大家介绍一下 PreferenceActivity 的几种标签: 系统提供的这些标签默认都是没有图片信息 Preference :没有图片单纯的文字 EditTextPreperence :带有编辑框 ListPreference :一个 List 集合,右边会有一个较小的向下的三角形 RingtonePreference :铃声的相关设置 其中上面的标签当中,都有 android:key 和 android:title 两个属性,如果你直接使系统内置的这些标签,其中没有任何的扩展,在通过 SharedPreferences 的时候对应的 key 便是 android:key 中的 key ,在你的应用中需要取值的时候也通过这个 key 来取,数据也不用开发者通过代码保存,系统自动就会保存您在设置中改变的数据。 Android

Cannot find TextView in PreferenceActivity

坚强是说给别人听的谎言 提交于 2019-12-06 07:34:36
In my PreferenceActivity I have some Preferences. One I inflate from layout: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.layout.settings); ... } protected void onResume() { super.onResume(); Preference registrationStatus = (Preference) findPreference("registrationStatusPref"); if (!TextUtils.isEmpty(somestring){ registrationStatus.setLayoutResource(R.layout.push_reg_status); TextView push_reg_status_txt = (TextView)findViewById(R.id.pushRegTxtPref); } .... } push_reg_status_txt is a TextView from push_reg_status layout, and