Reputation: 4579
Before AndroidX,
I would override the Preference's onCreateView(ViewGroup parent)
method to pass Custom Layouts to be used as Preference.
But in AndroidX's Preference, there is no onCreateView(ViewGroup parent)
method but it instead has onBindViewHolder(PreferenceViewHolder holder)
, I am not sure how to pass custom layouts & use them instead..
Any help would be highly appreciated!
Thanks!
Upvotes: 4
Views: 3398
Reputation: 76849
One has to assign it in the constructor already:
this.setLayoutResource(R.layout.preferences);
Here are some examples for onBindViewHolder().
Upvotes: 2