Random r = new Random();
int i1 = r.nextInt(80 - 65) + 65;
This gives a random integer between 65 (inclusive) and 80 (exclusive), one of 65,66,...,78,79
.
More Related Contents:
- Why does my function that calls an API return an empty or null value?
- Alarm Manager Example
- How to launch an Activity from another Application in Android
- How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?
- The AsyncTask API is deprecated in Android 11. What are the alternatives?
- How to make an Android device vibrate? with different frequency?
- Android: How to Enable/Disable Wifi or Internet Connection Programmatically
- How can I convert a part of Java source file to Kotlin?
- What do I use now that Handler() is deprecated?
- Place cursor at the end of text in EditText
- android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify
- onActivityResult() not called in new nested fragment API
- How can I resolve the error “The minCompileSdk (31) specified in a dependency’s AAR metadata” in native Java or Kotlin? [duplicate]
- JCenter deprecation; impact on Gradle and Android
- Android Get Current timestamp?
- how to access downloads folder in android?
- Disable SSL certificate check in retrofit library
- How to check permission in fragment
- Android calculate days between two dates
- unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)
- How to exclude an element from a Firestore query?
- Kotlin-android: unresolved reference databinding
- What is the best way to declare on UI component in android with Kotlin?
- Android Failed to instantiate one or more classes
- MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent
- How I can use callback in Kotlin?
- How can I get the average color of an image?
- Random element from string array [closed]
- Duplicate class in Kotlin Android
- How to hide the soft keyboard inside a fragment?