i'm using this code to generate the color values, but it sucks =( everytime i open the emulator, it gives me the same color combination. i guess there must be something wrong with my code. can someone help? thanks.
from the API, which if you don't know how to use, you should learn:
"If two instances of Random are created with the same seed, and the same sequence of method calls is made for each, they will generate and return identical sequences of numbers."
the value you use when creating the Random object does NOT set the size of the returned value, it just sets the seed value. i think what you need to do is create your random class with no value, and then when you call nextInt(), pass 256 in there.
i'm not sure why you are doing the bit shifting - can you explain that?
Joined: Apr 24, 2006
i just copied the bit shifting off somewhere else as for nextInt, the method does not allow me to put any parameters in it, which was why i tried putting it when i created randcolor. i checked the API for that already. anyway i took out the numbers when i created randcolor and it works fine so far. thanks!!! [ May 22, 2006: Message edited by: tan kian ]