I\'m adding TextViews programmatically in a for-loop and add them to an ArrayList.
How do I use TextView.setId(int id)? What Integer ID do I come up wit
TextView.setId(int id)
This works for me:
static int id = 1; // Returns a valid id that isn't in use public int findId(){ View v = findViewById(id); while (v != null){ v = findViewById(++id); } return id++; }