I have a preference xml in xml/preferences.xml:
<EditTextPreference
android:key="welcome_message"
android:title="Welcome message"
android:summary="Default welcome message"
android:dialogTitle="Tervetuloa-viesti"
android:dialogMessage="Input"
android:defaultValue="Default message" />
I know how to get the welcome_message from the preferences by code, but can I do it in XML something like:
<TextView android:id="@+id/txt" android:layout_width="wrap_content" android:text="(INCLUDE welcome_message HERE)" android:layout_height="wrap_content" />
in my main.xml and if so, how? Thanks.
As far as I know you can’t directly reference preference value from xml layout.