Hello guys.
Am implementing Autocomplete for places in compose android,but anytime i enter a letter in the search bar, the app crushes. I have followed the docs and initialized places with an API key but it seems that my intent reault is null. Below is my code snippet.
// Initialize Map api
Places.initialize(context, Constants.MAP_API_KEY)
val launcher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.StartActivityForResult()
) { result ->
if (result.resultCode == 2) {
val place = Autocomplete.getPlaceFromIntent(result.data)
place.address?.let {address ->
RequestServiceFormEvent.TaskLocationChanged(
address
)
}
}
}
Caused by: java.lang.NullPointerException: Intent expected to contain a Place, but doesn't.
help me solve this error