I'd like to dynamically a series of views that are accessible by an id name. ViewCompat.generateViewId
sounds like a promising way of doing so, but I have not seen a way to assign a name to that id.
I'm looking for something like this:
TextView tv = new TextView(this);
tv.setId(ViewCompat.generateViewId);
tv.setIdName("myTextView");
Is there any way to retrieve a dynamically generated resource id by a name?
Otherwise, is it possible to edit ids.xml
to assign a name to the id?