Here's what I need to do: Depending on what category is chosen in my app, anywhere from 0-5 Layouts that have a heading with a button, text and image on the button. All the text will be different for each Layout. I'd like this first half to use templates that I could duplicate as needed and give unique IDs.
The buttons will then show another layout that could be duplicated the same number of times, but each new layout, with individual elements, has to be unique. For this second half, I'd also like to use some templates that I could duplicate as needed and give unique IDs.
Is there a way to use strings to give a unique id?
This all needs to be with min api level 8. And if that doesn't work, what is the minimum api level that will work?
Update: My question is being downvoted with no explanation so maybe I should give some background.
First, I thought I could produce a template and just give it a unique id each time it's duplicated, but it requires an int rather than a string. I could create int constants, but that might require me to create variables that might never, or rarely, get used.
I tried creating a layout from scratch, but I don't know why it wasn't working; the code just quit, and Gradle wasn't giving me any errors. Yes, I could put that code here, but I don't really want to do it that way anyway.
I don't know what else to try so I wanted a push in the right direction from one of the largest collections of Android developers, something this question is currently debating, as @GEMISIS gave, which hopefully will help.
Thanks for your input!