android“打开”不列出chrome

时间:2017-07-30 22:07:48

标签: sl4a

我在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)

1 个答案:

答案 0 :(得分:0)

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

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

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

相关问题