int function ( ) { for ( ; ; ) { final int loc0 = sNextGeneratedId . get ( ) ; int loc1 = loc0 + 1 ; if ( loc1 > 0x00FFFFFF ) loc1 = 1 ; if ( sNextGeneratedId . compareAndSet ( loc0 , loc1 ) ) { return loc0 ; } } }
generate a value suitable for use in setid int this value will not collide with id values generated at build time by aapt for r.id . concode_field_sep AtomicInteger sNextGeneratedId concode_field_sep void setAlpha