Using android studio create a random word generatorSolutionA
Using android studio create a random word generator
Solution
Answer :
public class QuoteActivity extends Activity {
int numberQuotes = 10;
String[] quotes = new String[numberQuotes] {\"Shiva\", \"Ravi\", \"Charan\"};
String randomQuote = quotes[Math.floor(Math.random() * numberQuotes)];
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//Make a new text view passing Activity object
TextView txtView = new TextView(this);
//Set a text into view
txtView.setText(randomQuote);
//set the view into activity view container
setContentView(txtView);
}
}
![Using android studio create a random word generatorSolutionAnswer : public class QuoteActivity extends Activity { int numberQuotes = 10; String[] quotes = new S Using android studio create a random word generatorSolutionAnswer : public class QuoteActivity extends Activity { int numberQuotes = 10; String[] quotes = new S](/WebImages/28/using-android-studio-create-a-random-word-generatorsolutiona-1077722-1761565514-0.webp)