I have a list of strings (stored in a database, not as a resource) and
I want to allow the user to edit this list. This is easy enough to do with a normal
Activity
,
but in this application that list should be part of the user preferences
.
Basically it's a list of sentences the user wants to have available for use.
Since I want to provide a consistent UI, I want to add this to the preference screen:
<PreferenceScreen xmlns:android="...">
<!-- Some other categories and preferences here -->
<PreferenceScreen android:key="PREF_PDT"
android:title="Predefined Texts"
android:summary="View and edit the list of predefined texts">
</PreferenceScreen>
<!-- Some other categories and preferences here -->
<PreferenceScreen>
Now let's say I have a fully working Activity
that allows me to edit the texts in the database,
what can I do so that when the user taps the 'PREF_PDT' item the Activity
is used?
I take it I'll have to make some modifications to the Activity
or create a custom Preference view of some kind?
Update: So just to be clear, I do not need the 'list' screen to hook into the settings,
I just need to give the users the impression that they are still in the preferences part of the application (without breaking the navigation stack of course). Otherwise they have to go to one place to edit some settings and go to another place to edit the texts. They expect to find everything under 'settings'
Update: I've renamed the question from 'Custom Preference screen to edit a list of items' as it's clear now that what I'm trying to do is launch an activity from a PreferenceScreen. sh404's answer helps but I cannot find the right syntax to refer to the Activity I want to luanch. Perhaps it's monodroid specific. (ActivityNotFoundException)