I want to insert custom layout in android Preference class. My custom layout contains one ImageView and one TextView. There are 7 preferences and all preferences have same custom layout but different images and texts. Now one way to implement such Preference Screen is, make 7 .xml files one for each preference. Is there any other way so that I need to make only one .xml file and I can set image source and text string programatically ?
**EDIT : I need to show all 7 preferences simultaneously. **
You can use same layout and changing then at runtime. For example,
Or you can just change their data at runtime by using only single reference to use same layout.