toDoubleOrNull() is used so that:
- The keyboard closes
- The app requests location permission
- The number is rounded
- 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