webview中的html select标记似乎有问题

编程入门 行业动态 更新时间:2024-10-23 06:26:20
本文介绍了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标记似乎有问题

本文发布于:2023-11-03 12:44:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555164.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标记   webview   html   select

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!