Preference screen display text block

Viewed 21579

I am trying to make a Preference screen that just has an about, contact, and legal option, all of which when clicked just show text blurb and icon in a separate page, no shared preferences or anything.

I am having trouble understanding the hierarchy in order to display the text. I would like the flow to be: settings -> about -> the about text

Currently I have this, which gives me the category and option, but I don't know what to make it in order to display new text.

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

    <PreferenceCategory
            android:title="Info">
        <Preference android:title="About"/>


    </PreferenceCategory>
...
</PreferenceScreen>

I don't know what option to use to make the about clickable into a textview.

5 Answers

In my Settings page I want to show last backup date-time of my application data.

(Inspired by: https://developer.android.com/reference/android/content/SharedPreferences.Editor)

1) In my preference.xml:

<PreferenceCategory app:title="Backup last execution">
    <EditTextPreference
        app:key="backup"
        app:selectable="false"
        app:summary="never"
        app:useSimpleSummaryProvider="true" />
</PreferenceCategory>

2) In my class Utility { companion object }:

fun Utility.Companion.storeToPreferences(key:String, value:String){
       val sharedPref: SharedPreferences =
           PreferenceManager.getDefaultSharedPreferences(context)
       val editor = sharedPref.edit()
       editor.putString(key, value)
       editor.apply()
}

3) My call:

 Utility.storeToPreferences("backup", LAST_BACKUP)
Related