0

I use a webView in my app to show an external web page. That page has a <input type="date"/> field in it.

When I click on this field a native android datePicker is being shown, so far so good, its working great. The problem is that on some versions of 4.4.2 it will only appear once and after dismissing it the datePicker won't show again.

Have anyone stumbled on something similar? Is there a way to get hold of this datePicker instance to, maybe, explicitly hide/show it? I have tried the following to no avail:

        @Override
        public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
            return super.onJsAlert(view, url, message, result);
        }

        @Override
        public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
            return super.onJsConfirm(view, url, message, result);
        }

        @Override
        public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
            return super.onJsPrompt(view, url, message, defaultValue, result);
        }

many thanks!

  • Do you have access to the java code? Or your code is based on the server? – hoomi Sep 08 '15 at 17:31
  • Yes, I have access to the code. – Evgeny Maltsev Sep 08 '15 at 17:34
  • 1
    You can always expose a java function, which shows a native dialog, to your javascript code and call it from the javascript. That should work fine across android versions. However, that would require you to do some java coding. There is an example here http://stackoverflow.com/questions/10389572/call-java-function-from-javascript-over-android-webview – hoomi Sep 08 '15 at 17:42

0 Answers0