toDoubleOrNull() is used so that:

  1. The keyboard closes
  2. The app requests location permission
  3. The number is rounded
  4. Invalid text returns null instead of crashing
Answer

D) Invalid text returns null instead of crashing

It safely converts strings to Double.

Computer Science MCQ · More Lab: Showing a Location on Google Maps MCQs · Practise