I would like to create a single-choice dialog form ( similar to what you get when using setSingleChoiceItems on the Dialog builder) that is called from javascript out of a webview and returns its result to javascript.
1) My understanding is that onJsAlert would allow to implement the dialog call but it does only return true or false to the javascript. Is there any workaround that allows this method to return an integer ?
2) The select tag will create such a dialog on small screens, is it possible to invoke that manually from javascript ? I can not use the select tag mainly because I have a lot of items on my page that would call this dialog, having the whole list in a select tag for every single entry would create a huge overhead.
My apologies for not providing any code but I’m stuck in the concept here – I’ll post a working solution if I can get some hints on how to do this.
in webview you can use “shouldOverrideUrlLoading” method to fire Dialog.
ex: if you want to fire a alertbox , when you click some link
in html:
in java
to pass a data to javascript
here is the JavaScript function which is loaded in webview