【问题标题】:android "open with" not listing chromeandroid“打开方式”未列出chrome
【发布时间】:2017-07-30 22:07:48
【问题描述】:

我有一个在 Android 6.0.1(Nexus 7 平板电脑)上运行的简短 Python 程序 它告诉操作系统打开一个 html 文件。

不幸的是,当我得到“打开方式”对话框时,Chrome 不是选项之一。如果我选择 Firefox,一切正常,但我想要 Chrome。

这是python代码:

import android
droid=android.Android()
file_name = "file:///storage/emulated/0/Temp/Newspaper/Comics.html"
intent = droid.makeIntent('android.intent.action.VIEW', file_name, "text/html").result
droid.startActivityIntent(intent)

【问题讨论】:

  • 您可能想要更改标签和描述。关于这方面的 Android 问题将是关于 java、kotlin 或至少使用默认的 android sdk。我不确定您使用哪种包装器在 python 上编写代码,我会假设包装器本身缺少您所要求的任何内容。

标签: sl4a


【解决方案1】:

谢谢!!这就是答案。
我正在使用 SL4A 运行 python 程序,所以我猜测错误出在他们的代码中。如果我安装 ASTRO 文件管理器并将我的 python 代码切换为:

file_name = "content://com.metago.astro.filecontent/file/storage/emulated/0/Temp/Newspaper/Comics.html"

它让我选择 Chrome,一切正常。

【讨论】:

    猜你喜欢
    • 2020-06-02
    • 1970-01-01
    • 1970-01-01
    • 2014-08-15
    • 1970-01-01
    • 2021-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多