Android Question Random integer line throwing error

andyr00d

Member
Licensed User
Longtime User
Hi,

Got a strange error that I can't quite understand. Rnd function expects two min/max integers to be given, and I am passing two integers to it, which are the dimensions of a view which has already been added.

B4X:
Dim rndXRight As Int

rndXRight = Rnd(ivNation.Left + ivNation.Width,ivNation.Width * 2)

Which is throwing the following error: java.lang.IllegalArgumentException

Any ideas what I am doing wrong? Do I need to create a separate int for the two joined values from the view and pass that instead?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…