Difference between preference fragment and "regular" fragment

367 views Asked by At

I am attempting to write some tests to "assert" the headers of my settings app are being properly built. The settings app was built by someone else so I am attempting to understand their code before doing anything. They used "Preference Fragments" in this app. what is the difference between those fragments and "regular" fragments? How can I assert, using robolectric, that the fragment headers were built properly?

1

There are 1 answers

1
Lamorak On BEST ANSWER

Preference fragments are very different from regular fragment. Their layout is defined by the system and the content is inflated from XML resources. The purpose of this is to provide consistent settings screens in your apps. Have a look at the API Guide for more info.