2

I am developing a browser in Android webview, How can I detect if a website is asking for location permission and have custom control to give it or not.

  • 1
    Don't know if this link would help https://stackoverflow.com/questions/23498523/android-ask-for-permission-to-use-location-within-webview – debo.stackoverflow May 25 '18 at 13:52

1 Answers1

0

write below line in onCreate

webView.setWebViewClient(mWebViewClient); 

write below methode in your class

private WebChromeClient mWebChromeCient = new WebChromeClient() {
    @Override
    public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
        super.onGeolocationPermissionsShowPrompt(origin, callback);
    }
};

For more detail click tutorials link