【问题标题】:Opening the Youtube Application from a Webview从 Web 视图打开 Youtube 应用程序
【发布时间】:2010-11-19 16:23:21
【问题描述】:

这是我想做的:

  • 我有一个现有的网络视图,其中包含指向“www.youtube.com/existingchannel”的链接
  • 我知道如何覆盖 (shouldOverrideUrlLoading) 并检测何时单击该链接
  • 我希望 webview 将 Youtube 应用程序打开到该特定的 Youtube 频道

有人知道怎么做吗?

同样,我不想打开特定的视频,而是希望 Youtube 应用打开特定的 youtube 频道。

提前致谢!

【问题讨论】:

    标签: java android webview


    【解决方案1】:

    您唯一能做的就是发送带有 VIEW-Action 的 Intent

     Intent intent = new Intent(Intent.ACTION_VIEW);
     intent.setData(Uri.parse("http://www.youtube.com/existingchannel"));
     intent.addCategory(Intent.CATEGORY_BROWSABLE); // Optional, remove if it doesn't work
     startActivity(intent);
    

    当没有指定WebViewClient 时,这基本上就是WebView 已经做的事情。 YouTube 应用是否真正响应它完全取决于应用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-20
      • 1970-01-01
      • 1970-01-01
      • 2013-10-07
      • 1970-01-01
      • 1970-01-01
      • 2013-03-08
      • 1970-01-01
      相关资源
      最近更新 更多