diff --git a/app/src/main/java/com/example/hpostesting/presentation/MainActivity.kt b/app/src/main/java/com/example/hpostesting/presentation/MainActivity.kt index 854bb02..fefbb7e 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/MainActivity.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/MainActivity.kt @@ -251,7 +251,7 @@ class MainActivity : AppCompatActivity() { - try { + fusedLocationClient.lastLocation.addOnSuccessListener { location: Location? -> location?.let { DataHolder.selectedTest!!.location = @@ -270,15 +270,7 @@ class MainActivity : AppCompatActivity() { val rootView = findViewById(android.R.id.content) Snackbar.make(rootView, errorMessage, Snackbar.LENGTH_LONG).show() } - } catch (e: Exception) { - // Handle the exception here - e.printStackTrace() - FirebaseCrashlytics.getInstance().recordException(e) - // Display an error message to the user using a Snackbar - val errorMessage = "An error occurred: ${e.message}" - val rootView = findViewById(android.R.id.content) - Snackbar.make(rootView, errorMessage, Snackbar.LENGTH_LONG).show() - } +