简体   繁体   English

当从任何应用程序(如文件管理器)打开 PDF 文件时,我希望我的应用程序出现在选择器对话框中。我该怎么做?

[英]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.

相关问题 我不希望我的应用在打开URL时出现在选择器对话框中 - I don't want my app to appear on the chooser dialog when opening URL's 当用户从另一个应用程序(例如文件管理器应用程序)单击pdf文件时,如何将pdf阅读器应用程序添加为隐式意图? - How can I add my pdf Reader app as an implicit intent when a user clicks a pdf file from another app, like a file manager app? 如何让我的应用程序出现在app chooser中? - How do I make my app appear in app chooser? 当用户单击来自其他应用程序的任何链接时,想要在android应用程序选择器对话框中列出我的应用程序 - Want to listed my app on android app chooser dialog when user click on any link from different app 即使已经选择了默认应用程序,如何才能显示默认应用程序选择器对话框? - How do I get the Default app chooser dialog to appear even if the default app is already chosen already? 单击Android时,如何使我的文件管理器应用程序启动文件? - how do I get my file manager app to start a file when clicked Android? 如何在应用程序选择器中直接从URL打开PDF文件 - How to open PDF file directly from URL in app chooser 如何在我的应用程序中加载和查看 PDF 文件? - How do I load and view a PDF file in my app? 当我从对话框中选择浏览器甚至应用程序安装后,应用程序链接android没有打开我的应用程序 - Apps Link android is not opening to my app when i select browser from the dialog even app is installed 如何才能让我的应用仅针对某些网址出现在意图选择器中? - How can I have my app appear in the intent chooser only for certain urls?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM