views:

16

answers:

1

Hi.

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....

+1  A: 

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.

CommonsWare
So in essence, I would be better off creating a custom UI and replace the preference activity with it? To make things a bit clearer, only the "Currency" section affects the display in the application. The rest 2 are merely used for reference. Does that make any difference to the comparative?
Siddharth Lele
@Siddharth Lele: "So in essence, I would be better off creating a custom UI and replace the preference activity with it?" -- you already said you were doing that for "Contacts" and "Types of Projects". I would not launch a non-preference UI from a `PreferenceActivity`. "To make things a bit clearer, only the "Currency" section affects the display in the application. The rest 2 are merely used for reference. Does that make any difference to the comparative?" -- have no idea what you are talking about, sorry.
CommonsWare
My apologies for the confusion. I think I will take your earlier advice and go ahead with the custom UI which acts like a "preference" screen and take it from there. Since all the values are from the database, it ideally shouldn't be a problem, or at least I think it like that. I am pretty new to Android and JAVA, all of about a fortnight old. Thanks for your advice.
Siddharth Lele