setLayoutResource

open fun setLayoutResource(layoutResId: Int)(source)

Sets the layout resource that is inflated as the View to be shown for this preference. In most cases, the default layout is sufficient for custom preference objects and only the widget layout needs to be changed.

This layout should contain a ViewGroup with ID widget_frame to be the parent of the specific widget for this preference. It should similarly contain title and summary.

It is an error to change the layout after adding the preference to a PreferenceGroup.

Parameters

layoutResId

The layout resource ID to be inflated and returned as a View

See also