问题标签 [preferenceactivity]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - PreferenceActivity 中 createViewFromResource 上的 NullPointerException
我正在为Android
. 我正在关注这里讨论的一些代码,它使用ListPreference对象。我preferences.xml
的如下:
提到的所有字符串都在res/values/strings.xml
. 这两个数组定义在res/values/arrays.xml
:
当我选择它时出现问题ListPreference
(活动正确启动,并且所有其他首选项都有效)。我的PreferenceActivity中没有代码会影响这个ListPreference
。这是我的logcat
:
任何帮助将不胜感激!
android - Android Preferences 自定义布局编辑
我在我的偏好中添加了自定义布局。但现在我想以TextView
编程方式更改布局内部的文本。我怎么做?
现在看起来像这样:
谢谢
android - Android:从preferences.xml 启动Activity
我想从默认的preferences.xml 开始一个活动,带有<intent> 标签。活动经过了很好的测试,问题不在于那个。(我在我的应用程序中扩展了 PreferenceActivity,所以preferences.xml 是“附带”的)请看代码,有什么问题?
首选项.xml:
清单.xml:
当我按下“renameCourses 项目”时,Activity 没有调用,没有任何反应。LogCat 是“清晰的”,没有错误或警告。我搜索了很多,但没有找到解决方案,也许我只是错过了一些东西......请帮忙!
android - Android: "BadTokenException: Unable to add window; is your activity running?" at showing dialog in PreferenceActivity
I'd like to ask for some help: In my app, I have only one activity, a PreferenceActivity
(don't need other, it's just a simple background-sync app, so the PrefsActivity
is the Main/Launcher). After the user setup preferences, checks a checkBoxPreference
, and that starts (or stops) a service. At starting, a dialog shows.
But here is the problem: if the user press back (leave the activity), start it again, and than tries to check the checkBoxPref
., the prefsactivity
crashes. Dialog doesn't shows. I have no idea why, and how to fix it.
This code is exactly same with that part, what gives me the problem:
PrefsActivity.java:
prefs.xml:
and the manifest:
LogCat error:
After googleing a lot, I think, the wrong part is the ProgressDialog dialog = new ProgressDialog(this);
. Cause this
changes. But changing it to getApplicationContext()
, or PrefsActivity.this
doesn't help, the problem is still there.
Please, tell me why is this happening, and what could be the solution! Thank You!
I'm stuck, and now I have no idea...
android - Android 属性在编辑和提交后未更新
在我的 PreferenceActivity 的 onCreate 方法中,我设置了一些属性,如下所示:
它似乎工作但视图没有更新,所以当我打开属性时 onCreate 运行并更改值。然后我会在屏幕上看到“旧”值,直到我关闭并重新打开首选项屏幕,然后我才能看到新属性。
提交后我已经尝试过了:
但是没有任何效果。在我关闭并重新打开 PreferenceActivity 之前,我仍然看到“旧”首选项。
我究竟做错了什么?在 onCreate 方法中设置值后如何刷新 PreferenceActivity?
非常感谢你的帮助。
android - TabWidget 中的 PreferenceActivity
在我的程序中,我有一个 PreferenceActivity 作为我的选项卡之一。我执行以下操作。
这非常有效,并且可以帮助我的用户找到他们的所有设置。我的问题是我开始获得太多设置,所以我想将它们分组到子 PreferenceScreens 中。当我将这些 PreferenceScreens 之一添加到我的 xml 并将我的程序导航到其中时,我丢失了我的选项卡。您可以退出,一切正常,但它确实与程序的整个主题和计划的更新相混淆。我不确定的另一个选项是动态可扩展的 PreferenceCategory。我在 Dolphin Browser 中看到了这一点,但它们的设置也不是库存。
android - 在 PreferenceActivity on Resume 中重新加载首选项
在我的应用程序中,可能会在PreferenceActivity
未打开的情况下更改某些设置,而我遇到的一个问题addPreferencesFromResource
是调用 in onCreate
,所以说,我打开PreferenceActivity
,然后从那里转到另一个屏幕,然后做一些改变设置,然后按返回键回到PreferenceActivity
,那么布局上的某些设置没有改变。
那么,如何在不复制布局的情况下Preferences
每次调用onResume
(或)时重新加载?onStart()
android - 使用支持的相机图片尺寸列表填充 ListPreference
我正在开发相机应用程序,我需要做的是提供与用户设备兼容的分辨率列表。获取该列表没有问题,我可以使用 getSupportedPictureSizes() 方法。但是,我坚持的一点是用该列表填充 ListPreference。
ListPreference 是在一个 .xml 文件中创建的,该文件通过调用 addPreferencesFromResource(R.xml.cam_settings) 在我的 Settings PreferenceActivity 中使用。有什么想法可以让这个 ListPreference 使用支持的图片尺寸列表填充吗?
提前感谢您的帮助。
android - 您如何从偏好活动中调用时间选择器?
你能告诉我如何从偏好活动中调用时间选择器吗?
您能否在首选项活动中显示所需的 manifest.xml、layout.xml 和代码以及调用时间选择器所需的任何其他文件?
android - 如何使用编码即时更改 android:summary 的值?
我在 settings.xml 文件中有以下内容:
这是来自 strings.xml 文件:
您能告诉我如何使用编码即时更改 android:summary 的值吗?
我需要让它根据用户在首选项屏幕中选择的内容显示不同的值。
谢谢。
真的,埃马德