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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site