<?xml version="1.0"encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 1 -->
<PreferenceCategory
android:key="category_location_backup"
android:title="Store Backup Settings"
android:layout="@layout/textlayout" >
<CheckBoxPreference
android:key="checkboxpref_location_backup"
android:title="Store at default location"
android:summaryOff="Check to enable choose location backup"
android:summaryOn="Check to disable choose location backup"
/>
<Preference android:key="pref_folder_chosen"
android:name="default_browser"
android:summary="Choose a folder on SDCard to store backup file"
android:title="Choose location backup"
/>
</PreferenceCategory>
<!-- 2 -->
<PreferenceCategory
android:title="Auto Backup Settings"
android:layout="@layout/textlayout">
<CheckBoxPreference android:key="checkboxpref_auto_backup"
android:title="Enable Auto Backup Settings"
android:summaryOff="Check to enable automatic backup in device"
android:summaryOn="Check to disable automatic backup in device" />
<PreferenceScreen android:title="Auto Backup Settings"
android:summary="Setting Date and Time for automatic backup"
android:dependency="checkboxpref_auto_backup">
<PreferenceCategory android:title="SMS BACKUP SCHEDULE"
android:layout="@layout/textlayout">
<duytan.edu.vn.backupdemo.TimePreferenceCustom
android:key="timepref_auto_backup"
android:name="Default notification time"
android:summary="Choose the time to automatic backup SMS"
android:dialogLayout="@layout/time_preference"
android:title="Time to auto backup SMS"
android:layout="@layout/mylayout"/>
<duytan.edu.vn.backupdemo.ListPreferenceMultiSelect
android:key="daypref_auto_backup"
android:selectable="true"
android:dialogTitle="Day in week dialog"
android:summary="Choose the date to automatic backup SMS"
android:title="Day to auto backup SMS"
android:entryValues="@array/array_multi_list_preference_entry_values"
android:entries="@array/array_multi_list_preference_entries"
android:layout="@layout/mylayout"/>
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
<!-- 3 -->
<PreferenceCategory
android:title="Restore Settings"
android:layout="@layout/textlayout">
<ListPreference
android:key="listpref_restore"
android:title="Restore Type"
android:summary="Choose the Type of restore."
android:entries="@array/array_list_preference_entries"
android:entryValues="@array/array_list_preference_entry_values"
android:defaultValue="Keep current contains"
/>
</PreferenceCategory>
<!-- 4 -->
<PreferenceCategory
android:title="Other Settings"
android:layout="@layout/textlayout">
<Preference android:key="backup_setting_file"
android:name="backup_setting_file"
android:summary="Choose to backup all settings to file"
android:title="Backup all settings"
/>
</PreferenceCategory>
</PreferenceScreen>
2. Demo with all preferences element.
2.1. For the CheckBoxPreference element with android:key="checkboxpref_location_backup". This check for enable or disable users to choose the location in sdcard of device to store their backup file.
2.2. For the Preference element with android:key="pref_folder_chosen". When user click on this setting then the app run the File explorer for choose one directory to store the backup file
When the File Explorer show up, if you choose the DCIM folder and return with back button on device
2.3. The CheckBoxPreference with android:key="checkboxpref_auto_backup" enable or disable autto backup.
If users enable auto bakup then they can choose the days and time for that.
EmoticonEmoticon