【问题标题】:Can I open the webview widget with an implicit intent?我可以用隐含的意图打开 webview 小部件吗?
【发布时间】:2016-04-04 14:55:50
【问题描述】:

我知道我可以使用显式意图打开 webview 小部件,但有没有办法可以使用隐式意图打开 webview 小部件?

好像不能用:

Uri uri = Uri.parse("http://www.google.com");
Intent web_intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(web_intent);

如何实现在我的 webview 小部件上打开网站?

【问题讨论】:

    标签: android android-intent webview


    【解决方案1】:

    如何实现在我的 webview 小部件上打开网站?

    WebView 上调用loadUrl(),并传入您的网址。

    【讨论】:

    • 谢谢。还有一个后续问题,如果我想在单击链接时使带有 webview 小部件的选项卡可见,我应该使用:“webView.setVisibility(view.VISIBLE);”吗?我以前试过,但它似乎不起作用。
    • @smart_cookie:这完全取决于您使用的标签。如果它们基于ViewPager,请在ViewPager 上调用setCurrentItem() 以切换页面。
    猜你喜欢
    • 1970-01-01
    • 2011-08-13
    • 1970-01-01
    • 1970-01-01
    • 2020-01-27
    • 1970-01-01
    • 2012-04-28
    • 2015-02-15
    • 1970-01-01
    相关资源
    最近更新 更多