webview中的html select标记似乎有问题 [英] html select tag in webview seems to be problematic

查看:442
本文介绍了webview中的html select标记似乎有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用一个简单的Webview完成了一个应用程序; 当我从Web视图中打开页面"search.php"时,我触摸html select以从其他类型的单词中进行选择. 但是...休斯顿!我们要出问题了! :D当我在输入字段中写我需要的东西时,没问题,但是当我触摸(仅触摸)选择字段以选择我需要的东西时(我可以选择几种当地人,例如:酒吧,迪斯科舞厅,餐厅.等等...)我的应用程序崩溃了!我问为什么? 如果我在另一个页面(例如,contact.php)中放置相同的html,则应用程序不会崩溃. 有什么问题吗?

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?

在这里,我对银河s2做的屏幕截图.看看,当我触摸html select标签(您可以看到它,因为它是浅蓝色)时,我已经完成了屏幕截图,很明显,应用程序崩溃了.大声笑!

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!

推荐答案

确保使用活动"上下文初始化您的WebView.我之前遇到过这个问题,这是因为我们使用了错误的上下文.应该将运行WebView的Activity传递到WebView的构造函数中.

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.

这篇关于webview中的html select标记似乎有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆