【问题标题】:How to open browser and set html data to it by intent, Android如何通过意图打开浏览器并为其设置html数据,Android
【发布时间】:2011-08-31 14:22:16
【问题描述】:

我想打开安卓浏览器,在上面设置html数据。我不想使用 webview 控件。我该怎么做?

【问题讨论】:

    标签: android html web


    【解决方案1】:

    尝试以下方法:

    String URL= [url];
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(URL));
    startActivity(intent);
    

    您可以将html文件本地保存在SD上并提供url。

    祝你好运

    【讨论】:

    • 是的,刚刚明白我没有正确回答,请看更新。
    【解决方案2】:

    不是特定于 android,而是通用的现代浏览器:

    您可以将整个文档制作成一长串URI,然后定位到显示原始文档。见http://en.wikipedia.org/wiki/Data_URI_scheme

    有人提供了一个方便的基于 Web 的工具来将任何文档转换为 Data URI 字符串: http://www.dopiaza.org/tools/datauri/

    大小限制因特定网络浏览器而异。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-07-29
      • 2020-08-22
      • 2015-09-06
      • 1970-01-01
      • 2018-03-21
      • 2011-03-09
      • 2014-02-18
      相关资源
      最近更新 更多