Step 1: Create a layout xml for the header and footer as per your requirement.

header.xml

footer.xml

Step 2: Now let’s inflate these header and footer views and add it to our list view .

Complete Code