Android 临时 Webview
问候。
我想让我的应用程序具有一个功能,以便当用户选择时,会弹出一个 Web 视图,他们可以查看它,然后通过按屏幕上的按钮或后退按钮将其关闭。我该怎么做?
谢谢。
Greetings.
I would like to have my application have a function so that when the user chooses, a web view will pop up they can look at it and then dismiss it by either pressing a button on the screen or the back button. How would I do this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个包含
WebView
和您需要的所有其他内容的Activity
,并通过Intent
启动该Activity
。当用户完成WebView
中的操作后,只需让他按后退按钮即可。Create an
Activity
containing yourWebView
and all the other stuff you need and have thatActivity
be started through anIntent
. When the user is done with doing stuff in theWebView
just let him press the back button and you're fine.您只需创建一个包含带有所需 url 的 webview 的活动,然后拦截 url 点击并在您的应用程序中做出相应的反应。
http://developer.android.com/reference/android/webkit/WebView.html
You just create an activity that contains a webview with the url you need and then you intercept the url clicks and react accordingly in your app.
http://developer.android.com/reference/android/webkit/WebView.html