Quantcast
Channel: android random number problem - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by DragonLord for android random number problem

Based on your description, your database query is 1's-based. Java nextInt is 0's-based, that is, .nextInt(10) will generate a random number between 0 and 9. So your proper solution is to change line 3...

View Article


Answer by Mark B for android random number problem

First, I would try moving the line:Random generator = new Random();To your class's constructor or some other place where it will only get created once. That should definitely help.Other than that, the...

View Article

android random number problem

Tried to create a random method that would query the database, obtain the number of rows in the database, and then grab a random number between 1 and the total number of rows to fetch a specific item...

View Article
Browsing all 3 articles
Browse latest View live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>