默认首选项中的新活动

发布于 2024-09-25 09:34:42 字数 1346 浏览 0 评论 0原文

我已经使用必要的选项设置了默认的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青巷忧颜 2024-10-02 09:34:42

也许我根本不应该使用默认的 Android 首选项?

恕我直言,如果您要为“联系人”和“项目类型”呈现非首选项 UI,那么您“不应该使用默认的 Android 首选项”。

Perhaps, I shouldn't be using the default android preferences at all?

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文