android通过webview中的javascript接口启动toast

发布于 2024-11-30 13:43:40 字数 441 浏览 4 评论 0原文

我的 Android 应用程序有一个 WebView,其中我在 WebView 中有一个按钮。当单击网页中的按钮时,我应该通过 JavaScriptInterface 显示来自 javascript 的 toast。

我从android开发者网站http://developer.android.com/guide/webapps引用了这个例子/webview.html

当我实现这个 javascript 和 android 代码时,Toast 仅出现在 Android 2.2 中,而不出现在任何其他 API 级别中。

如果您遇到了这个错误问题,有人帮助我吗??? 我找不到任何解决方案...请帮助我..

问候, 桑索什·普利曼。

My android app has a WebView in which i have a button in webview. When clicking the button in the web page i should display a toast from javascript through JavaScriptInterface.

I referred this example from android developer site http://developer.android.com/guide/webapps/webview.html

When i implemented this javascript and android code, Toast appears only in Android 2.2 but not in any other API level.

Someone help me if you had crossed over this error problem???
I couldn't find any solution for this... Please help me out..

Regards,
SanthoshPulliman.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长亭外,古道边 2024-12-07 13:43:40

我不确定较低级别的 API,但从 JavaScript 到 Java 的桥梁在 2.3+ 中被打破了。 http://code.google.com/p/android/issues/detail ?id=12987

I am not sure about the lower level API, but the bridge from JavaScript to Java is broken in 2.3+. http://code.google.com/p/android/issues/detail?id=12987.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文