From 228dcd44e2bc6d7d0424415f1a0e22a45810b3a3 Mon Sep 17 00:00:00 2001 From: PranshulGG Date: Sun, 16 Jun 2024 19:04:02 +0530 Subject: [PATCH] updated MainActivity --- app/src/main/java/com/example/weathermaster/MainActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/weathermaster/MainActivity.java b/app/src/main/java/com/example/weathermaster/MainActivity.java index ad98602e2..f493e1413 100644 --- a/app/src/main/java/com/example/weathermaster/MainActivity.java +++ b/app/src/main/java/com/example/weathermaster/MainActivity.java @@ -175,9 +175,11 @@ public class MainActivity extends AppCompatActivity { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { // Permission granted, proceed with enabling geolocation in WebView webview.getSettings().setGeolocationEnabled(true); + webview.reload(); } else { // Permission denied, show an explanation to the user - Toast.makeText(this, "Location permission is required for geolocation", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, "Location permission is required", Toast.LENGTH_SHORT).show(); + } }