updated MainActivity

This commit is contained in:
PranshulGG committed 2024-06-16 19:04:02 +05:30
1 parent e5715cd2c8
commit 228dcd44e2
1 file changed
+3 -1
@@ -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();
}
}