默认首选项中的新活动
我已经使用必要的选项设置了默认的 android 首选项。首选项的主要原因是允许用户管理他们的资源。在我的应用程序的上下文中,它们是“联系人”、“项目类型”和“货币”。
“货币”部分运行良好。还只是显示,还没有编程。但我真正想做的是,当单击“联系人”或“项目类型”时,他们应该打开另一个自定义活动来让用户管理他的联系人。顺便说一句,这些是安卓联系人。这是一个连接到数据库表的活动,允许用户管理他的联系人和项目类型。
请问对此有什么建议吗?也许,我根本不应该使用默认的 android 首选项?
这是我的首选项的 XML 代码:
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory
android:title="Manage your resources" >
<ListPreference
android:key="contacts"
android:title="Manage your Contacts"
android:summary="Click here to ADD, EDIT and DELETE Contacts" >
</ListPreference>
<ListPreference
android:key="projects"
android:title="Types of Projects"
android:summary="Click here to maintain a list of Types of Projects that match your profession" >
</ListPreference>
<ListPreference
android:key="currency"
android:title="Select currency"
android:summary="Set a default currency that you wish to use" android:entryValues="@array/entryvalues_list_preference" android:entries="@array/entries_list_preference">
</ListPreference>
</PreferenceCategory>
提前致谢....
I have setup my default android Preferences with the necessary options. The prime reason of the Preferences are to allow users to manage their resources. In the context of my app, they are "Contacts", "Types of projects" and "Currency".
The "Currency" section works fine. The display just yet, not the programming. But what I really want to do is, when either of the "Contacts" or "Type of projects" is clicked, they should open another custom activity to let the user manage his contacts. These are by the way, not the android contacts. It is an activity connected to a database table allowing users to manage his contacts and his type of projects.
Any advise on this please? Perhaps, I shouldn't be using the default android preferences at all?
This is my XML code for the Preferences:
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory
android:title="Manage your resources" >
<ListPreference
android:key="contacts"
android:title="Manage your Contacts"
android:summary="Click here to ADD, EDIT and DELETE Contacts" >
</ListPreference>
<ListPreference
android:key="projects"
android:title="Types of Projects"
android:summary="Click here to maintain a list of Types of Projects that match your profession" >
</ListPreference>
<ListPreference
android:key="currency"
android:title="Select currency"
android:summary="Set a default currency that you wish to use" android:entryValues="@array/entryvalues_list_preference" android:entries="@array/entries_list_preference">
</ListPreference>
</PreferenceCategory>
Thanks in advance....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恕我直言,如果您要为“联系人”和“项目类型”呈现非首选项 UI,那么您“不应该使用默认的 Android 首选项”。
IMHO, you "shouldn't be using the default android preferences" for "Contacts" and "Types of Projects", if you will be rendering a non-preference UI for them.