[英]I want my app to appear on the chooser dialog when opening PDF file from any app like file manager ..How I do this?
When we click on and pdf document file for open it, we see the 'OPEN WITH' dialog, as show below image screenshot , I want my app to appear in this 'OPEN WITH' dialog when opening PDF file from any app like file manager,当我们单击pdf文档文件打开它时,我们会看到“打开方式”对话框,如下图所示,我希望我的应用程序在从任何应用程序(如文件管理器)打开 PDF 文件时出现在此“打开方式”对话框中,
EX: This functionality used by adobe pdf viewer/ Drive Pdf viewer/other pdf reader app, for open file from any where. EX:adobe pdf 查看器/驱动器 Pdf 查看器/其他 pdf 阅读器应用程序使用的此功能,用于从任何位置打开文件。
I created "PdfOpener" activity and added an intent filter for it in the manifest.我创建了“PdfOpener”活动并在清单中为其添加了一个意图过滤器。 My app is called RoomWordsSample.我的应用名为 RoomWordsSample。 The intent filter tells the android system that there is an activity within my app, called PdfOpener, that claims to have the capability of opening pdf files.意图过滤器告诉 android 系统,我的应用程序中有一个名为 PdfOpener 的活动,它声称能够打开 pdf 文件。 So the android system trusts this claim and lists my app in the app chooser dialog box.因此 android 系统信任此声明并在应用程序选择器对话框中列出我的应用程序。 Download the gif I uploaded on google drive, it shows before adding intent filter and after adding intent filter . 下载我在google drive上上传的gif ,它在添加意图过滤器之前和添加意图过滤器之后显示。 The system only shows app chooser dialog box only if there is more than one app that can open pdf files.只有当有多个应用程序可以打开 pdf 文件时,系统才会显示应用程序选择器对话框。 I took the code for the intent filter from this question intent-filter code .我从这个问题意图过滤器代码中获取了意图过滤器的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.