html select tag in webview seems to be problematic

有些话、适合烂在心里 提交于 2020-01-04 13:52:47

问题


i've done an app with a simple webview; when i open from my webview the page "search.php" and i touch the html select to choose from a different type of words.. but...Houston! We gotta problem! :D When i write what i need in the input field it's all right, but when i TOUCH (only touch) the select field to choose what i need (i can choose few type of locals, like: bar, disco, restaurant..etc...) my app crash! Im asking WHY? If i put the same html select in another page (contact.php for example) app DOESN'T crash.. what's the problem?

Here, the screenshot i've done with my galaxy s2. Have a look, while i was touching the html select tag (you can see it, because it's light blue) i've done the screenshot, and obviusly app crashed. LOL!


回答1:


Make sure your WebView is initialized with the Activity context. I ran into this problem before and it was because we were using the wrong context. The Activity in which the WebView runs should be passed into the constructor of the WebView.



来源:https://stackoverflow.com/questions/15334446/html-select-tag-in-webview-seems-to-be-problematic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!