Android - 在 webview 中创建自己的按钮,将某些内容从网站检索到 webview
我目前正在android 上做一个应用程序(项目)。我想知道如何在 webview 中创建自己的按钮,或在 webview 中创建选项卡栏。另外,我想从网站(或者更确切地说,从 livejournal,具体来说)检索某些内容,例如,我不想要 livejournal 本身中的按钮,我只想要某些内容,也许像一些实时日记帖子。我有什么办法可以做到这一点吗?
提前非常感谢!
I'm currently doing a application (project) on android. I would like to know how to create my own buttons in webview, or creating a tab bar in webview. Also, I would want to retrieve certain contents from a website (or rather, from livejournal, to be specifc), like, I do not want the buttons that are in livejournal itself, I just want certain contents, maybe like some live journal posts. Is there any way I could do this?
Thank you so much in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该将 WebView 放在选项卡中,而不是将选项卡放在 WebView 中。至于从 LiveJournal 中提取信息有两种可能性。他们要么有一个公共 API,您可以访问该 API 以获取所需的数据并使用该数据来填充您的应用程序,要么没有。如果他们不这样做,你唯一的办法就是提取原始 html 并尝试解析它。那时,您可能只需按原样使用网页即可。
Instead of putting tabs in the WebView you should put the WebView in Tabs. As for pulling information from LiveJournal there are two possibilites. They either have a public api that you can access to get the data you want and use that to populate your app or they don't. If they don't your only recourse would be to pull in the raw html and try to parse it. At that point you might was well just use the webpage as is.