How to Add a while loop

The while statement continually executes a block of statements while a particular condition is true.

1.Add the code below to the onCreate method. Below is the syntax for a while loop.

  while (expression) {
        //statement(s)
    }