Recreate the PreferenceActivity from a ChildPreference without leaving the ChildPreference
<p>Is it possible to recreate the PreferenceActivity from a ChildPreference without leaving the ChildPreference on the Screen? The reason is, that I have a ChildPreferenceScreen on which I can add or remove PreferenceItems with a CustomDialog. At the moment it works if I press the back Button to show the main PreferenceScreen and go back to the ChildPreferenceScreen. But it should refresh the screen directly after closing the CustomDialog with positive result.
I have following Class to create the preferences:</p>

<pre><code>public class Settings extends PreferenceActivity 
                        implements OnPreferenceClickListener{

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.preferences);
    for (int i = 1; i &lt; data_here.length; i++) {
        if(table.get("Begin"+String.valueOf(i))!= null){  
            data_here[i] = "Begin"+String.valueOf(i) + "=" + table.get("Begin"+String.valueOf(i))+ ";";
            // Change Pref View
            Preference pref = (Preference) findPreference("freetime"+i);
            pref.setSummary(table.get("Begin"+String.valueOf(i)) + " - " + table.get("End"+String.valueOf(i)));
            pref.setTitle(table.get("Title"+String.valueOf(i)));
            pref.setEnabled(true);
            Preference pref_tmp;
            try {
                pref_tmp = (Preference) findPreference("freetime"+(i+1));
                pref_tmp.setEnabled(true);
            } catch (Exception e) { }   

        }else{
            PreferenceScreen childPrefScreen = (PreferenceScreen) findPreference("free_time_screen");
            Preference pref = (Preference) findPreference("freetime"+i);
            if(pref.isEnabled() == false){
                childPrefScreen.removePreference(pref);
            }
        }
...
</code></pre>

<p>Now the problem is, I have to recreate the PreferenceActivity from the DialogPreference Class:</p>

<pre><code>class CustomPreference extends DialogPreference{
            @Override
            protected void onDialogClosed(boolean positiveResult) {
               super.onDialogClosed(positiveResult);

                if (positiveResult) {
// here I have to recreate the PreferenceActivity Class
</code></pre>

<p>This is the XML:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:key="main_screen"&gt;


    &lt;PreferenceCategory 
        android:title="Settings"
        android:key="settings"&gt;

        &lt;CheckBoxPreference 
            android:key="Use_just_A-week"
            android:summary="summary..."
            android:title="Week" 
            android:defaultValue="true"
        /&gt;



    &lt;/PreferenceCategory&gt;



        &lt;PreferenceCategory android:title="Timet"
            android:key="free_time_cat"&gt;
        &lt;PreferenceScreen
            android:key="free_time_screen"
            android:title="Add time"
            android:summary="Additional preferences held in another page"&gt;
        &lt;de.CustomPreference 
           android:dialogLayout="@layout/custom_layout"
           android:dialogTitle=""
            android:dialogMessage="Dialog summary"
            android:key="freetime1"
            android:title="Add time"
            android:summary="Preference summary"
            android:defaultValue="Default Value" /&gt; 
         &lt;de.CustomPreference 
           android:dialogLayout="@layout/custom_layout"
           android:dialogTitle=""
            android:dialogMessage="Dialog summary"
            android:key="freetime2"
            android:title="Add time"
            android:summary="Preference summary"
            android:defaultValue="Default Value" /&gt;

...
</code></pre>
