Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8432913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:14:53+00:00 2026-06-10T06:14:53+00:00

I am a beginner and I am making a an android app. My goal

  • 0

I am a beginner and I am making a an android app. My goal is to have the app randomly return a specific word from a list of word when a button is pressed. How should I go about doing this? Also, I am using eclipse and do not have much experience at all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:14:55+00:00Added an answer on June 10, 2026 at 6:14 am

    Since you already mentioned in your question that you want to generate a word from a list of words, I assume that you already have the list prepared.

    Use the following to generate a random number and then display the word corresponding to that index.

    Random randomGenerator = new Random();
    int randomInt = randomGenerator.nextInt(100); // maximum value 100; you can give this as the maximum index in your list of words
    

    Note : do not use Math.random (it produces doubles, not integers)

    import java.util.Random;

    EDIT :

    Assume that you have the list of words in a String array which contains 30 words.

    String wordList[] = new String[30];
    // enter the words in the wordList (if you have a String, use a Tokenizer to get the individual words and store them in wordList)
    int randomInt = randomGenerator.nextInt(30);
    String wordToDisplay = wordList[randomInt];
    

    Then, you can display wordToDisplay in your TextView by using mTextView.setText(wordToDisplay);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started making an Android app that requires a list of 20
I'm a beginner to SQL making a stored procedure with the goal of taking
Beginner iOS dev here. I have a problem in my array. Im making an
I am a beginner. I am making an education app which will read out
Beginner in Android development. My code crashes. I have made a simple Java method
Beginner here, I have a simple question. In Android what would be the best
I'm making a simple 2d game for the android platform, which works perfectly from
I am a beginner so please bear with me. I am making an app
I am making an iPhone app, where the requirement is such that user should
I am a beginner with Android, and I have a strange bug with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.