I am more familiar with web, but I am programming an Android app.

This is a beginner question, but I'm having trouble wrapping my head around reusable views in Android. On the web, I would create a partial view and pass parameters to be added via a templating language. What is the best way to do this on Android?

More specifically, I am trying to add a grid view where each slot of the grid has an image and a subtitle with a border. I want to dynamically load the image and subtitle from the database, and add an unknown number of images to the grid.

How could I create a view to hold the images and subtitles and then dynamically load them into the grid with different data?