Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the range of R.id (min and max integer value) of any view

I am creating an android app in which I want to create Boolean Array of size of maximum value of IDs so that I can uniquely store the changes on the buttons.

Suppose my button id is 102931, when user click on the button I will make change in the Boolean array's 102931th element so that later I can check the changed value in it.

Now My Question is

What is the range of IDs(min-max) for any view?

like image 265
mdadil2019 Avatar asked Jul 27 '17 04:07

mdadil2019


1 Answers

They can be positive integers, but also, ids generated at build time will have a value greater than 0x00FFFFFF. If you look at View.generateViewId() you will see that dynamically generated ids are in range 1 to 0x00FFFFFF inclusive. Above that, there are R.id's ids.

The default id of a View is View.NO_ID which has value -1

like image 83
lelloman Avatar answered Nov 05 '22 05:11

lelloman