Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COHi! the basic idea behind the random / increasing ids was to avoid somehow to add duplicate ids without manually looking up all the fix ids in the layout xml, and checking, if the new id is already among them. Thank you for the answer, but could you please tell me, how these ids are generated? As far as i can tell, like my second option: the IDE chooses a random number and adds one with each new id.
      singulars
    2. COIf you don't add an id then you won't be able to access the view by id. Have you looked at adding a tag to the view and then accessing by a tag? Is the option of iterating through the child views a possible solution to what you are trying to achieve? Generally you only need an id if you need to access a specific view in the hierarchy. If the view is a list or grid type parent then you will access the child views through an adapter class which will handle setting and retrieving the view in question. Maybe further information regarding the context of the question would help?
      singulars
    3. COI have no specific in mind, what i'm trying to achieve. Truth is, that the question came up, when i wrote a wrapper class for RadioButtons, to create something similar like a RadioGroup without being a View, just handling the buttons check state. This class handles, selects and deselects the RadioButtons by id, and when i started testing it with larger amount of RadioButtons, i needed to generate ids dinamically. Then i started to wonder about these questions. Thanks for your help again, i think the most important to know was, that runtime generated ids are accessible by findViewById().
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload