This question is more about best practices.
I'm working on some code that creates a UI from a dynamic XML file. It took me quite a while to discover that Dynamic Views have an ID of -1. Which means if you want to layout Dynamic Views in relation to other Dynamic Views you need to give them IDs on creation.
So I did that, but I don't really like the solution I came up with, and there's a chance that I could accidentally give the same ID to two elements.
Is there a way to let Android assign unique IDs to these dynamic views, or do I have to create some sort of ID tracking code myself?