I’ve got with my own layout.
I would like to receive the text from the editText after positive button on the layout is clicked. But in onPreferenceChange, I always get only the default value.
It seems that I need to bind my own EditText to the preferences somehow, but I don’t know how and where to do this.
Can anybody help me?
To answer my own question:
First of all, in PreferenceScreen, you need to state:
<full.path.to.your.OwnLayoutClass
android:name=”whatevever”
android:dialogLayout=”@layout/your_own_layout” />
your_own_layout can be anything you’d like, linearlayout with of buttons, editTexts, according to your wishes.
Essential is the class representing your own preference Dialog. Here is a simple example of how to do it:
Important references:
I need to have a custom dialog in Preferences
Concise way of writing new DialogPreference classes?
Android: launch a custom Preference from a PreferenceActivity