mirror of
https://github.com/PranshulGG/WeatherMaster.git
synced 2026-10-23 19:43:40 -05:00
updated MainActivity
This commit is contained in:
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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user