- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我试图在 android 应用程序上打开一个网页,url sheme 有点特殊,它必须在阅读器模式下打开一个 url:about:reader?url=example.com
我是这样做的
Uri intentUri = new Uri.Builder().encodedPath("about:reader")
.appendQueryParameter("url", Uri.encode("example.com"))
.build();
// Try to open in Firefox If available or use default
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(intentUri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage("org.mozilla.firefox");
try {
getApplicationContext().startActivity(intent);
} catch (ActivityNotFoundException ex) {
intent.setPackage(null);
getApplicationContext().startActivity(intent);
}
日志:
E/AndroidRuntime: 致命异常: main
由以下原因引起:android.content.ActivityNotFoundException:找不到处理 Intent 的 Activity { act=android.intent.action.VIEW dat=about:reader?url=http://example.com
有办法实现吗?
最佳答案
试试这个
final String pdf_url = "http://example.com"; // DON'T forget http{s}:// prefix.
// Try to open in Firefox If available or use default
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(pdf_url));
// You can also using Google viewer
// intent.setDataAndType(Uri.parse( "http://docs.google.com/viewer?url=" + pdf_url), "text/html");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage("org.mozilla.firefox");
关于android - 如何在 Android 上使用 Intent 打开关于 :reader? url=example.com 的 Firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51615968/
class ReadLock { private: std::mutex readWriteMutex; std::mutex conditionmtx; std::condi
我在 utf-8 编码文件中有多个 messages.properties 文件(messages_en_US.properties、messages_fr.properties,...)。在这些属性
我正在尝试从 google reader api 中检索单个选定项目。是否可以通过 API 调用通过 ID 获取项目,或者我是否必须访问该项目提要并从那里获取它? 最佳答案 您可以使用 POST 到
好的,所以我有一个应用程序可以与 GR 的“api”紧密结合。 一切正常,但最近我收到来自 Google 的许可被拒绝返回。如果我退出 GR 并使用我的应用程序重新登录,一切都会重新开始。这让我相信
我想要的是最终得到类似的东西: public class InterleavedBufferedReader extends BufferedReader { ... } 并将其用作: Reader[
reader monad 有一个asks 函数,它的定义与reader 函数完全相同,为什么它作为一个单独的函数存在,与 的定义相同读者?为什么不总是使用阅读器? class Monad m => M
当使用csv模块读取文件时,有两种方法可以遍历csv.reader返回的生成器。 with open('foo.csv') as f: reader = csv.reader(f) r
我想在 Go 中按照 here 中的要求做同样的事情. 我正在解析一个巨大的日志文件,我需要逐行解析它。在每一行上,我将该行反序列化为一个结构。数据可能来自任何数据源(文件、网络等)。因此,我在我的函
我在golang的zlib/reader.go文件中找到了很多像r.(flate.Reader)这样的代码片段。这是什么意思? https://golang.org/src/compress/zlib
我正在 Spring MVC 中包装 Freemarker 模板加载器,如所述 here在 html 页面中进行默认转义。 所以,我需要用我的字符串包装来自 java.io.Reader 的内容,而不
为什么这个 PDF 在 Foxit Reader 而不是 Adobe Reader 中显示签名? 这是来自 Syncfusion PDF library 的代码用于生成它(另请参阅有关 signi
我有一个巨大的tbb::concurrent_unordered_map被多个(~60)线程同时“大量读取”。 我每天需要清除一次(完全清除或选择性清除)。在 tbb 中删除显然不是线程安全的实现,因
好像是 Hibernate.createClob(Reader reader, int length)在 3.6.x 版本中已弃用 它建议使用使用 LobHelper.createClob(Reade
这是我的实际解决方案 private def transpose[E, A](readers : Seq[Reader[E, A]]) : Reader[E, Seq[A]] = Read
DataReader[0].ToString() 和 (string)DataReader[0] 有区别吗? 我的猜测是,如果数据库类型不是字符串类型,(string)DataReader[0] 可能
我想制作一个 C# 程序来保存 pdf 和 djvu 文件的书签。如何从 AcroRd32/DjVuReader 进程中找出当前页码? 最佳答案 您可以通过 Adobe Acrobat 支持的 D
什么更好 var s = (string)reader[0] 或 var s = Convert.ToString(reader[0]) ? 最佳答案 我会说 reader.GetString(0
我对非官方阅读器 api 进行了大量研究,并筛选了其他问题,但没有一个完全满足我的要求。如果您知道文章 id 有据可查,如何分享文章,但如果您不知道 id,我想知道如何分享文章(即如何转换 url -
这是一个简单的示例,用于将 xml 文件读入 WebRowSet 对象,然后将数据从该对象加载到数据库。 import javax.sql.rowset.RowSetProvider; import
这样的转换对于任何仿函数都是可能的,不仅是Future: implicit class RichFunctorReader[F[_]: Functor, A, B](fr: F[Reader[A, B
我是一名优秀的程序员,十分优秀!