I know this can seem a weird question but for me it would be really handy if I could compose a layout XML from a set of other xml files pointed by the main XML file. The reason is that I have some list item views defined in this xml and would like to reuse then in other places. Is it possible or the only way to do it is just Coping and pasting it?
Share
You can include different layout files in a single layout using the ‘include’ tag
Another way is the ViewStub. If you want to load asynchronously your layout you can have:
And the in your code when you want you can write:
For some reference: http://developer.android.com/reference/android/view/ViewStub.html