In haste I made this version of a dynamically configured screen with settings
onCreate(....{ EditTextPreference[] etprefArr = new EditTextPreference[10]; for (int i = 0; i < etprefArr.length; i++) { etprefArr[i] = new EditTextPreference(this); etprefArr[i].setKey("etpOwner" + i); etprefArr[i].setTitle(preference.getString("etpOwner" + i, null)); etprefArr[i].setIcon(R.drawable.telephone_1_32); ownerScreen.addPreference(etprefArr[i]); if (etprefArr[i].getTitle()==null ||etprefArr[i].getTitle().equals("")){ break; } } The creation of an EditTextPreference works as it was intended (if the existing EditTextPreference filled, a new one appears, only the question is that the PreferenceScreen containing the EditTextPreference data is updated only after the re-creation of PreferenceActivity .
Tell me how to dynamically form the PreferenceScreen . There was an idea to create your own class that extends the PreferenceScreen or EditTextPreference . Perhaps there are more correct / simple solutions.
The current screen version looks like this: The "static" EditTextPreference "Add" has been added to it. When I click on it, a standard dialog appears, I enter a new value and, when I save it, I save the value to a new one in the Preference under my name + (count + 1). As a result, the new value is added but not displayed on the PreferenceScreen .
And so for each time you click "Add."
The next time you PreferenceScreen this PreferenceScreen they PreferenceScreen through all the Preferences with the name "+ (count + 1,2,3 ...)". I get a screen with values, but when they are corrected, old values are displayed on the screen
