简体   繁体   English

如何通过意图打开其他文件管理器应用程序?

[英]how to open other file manager apps via intent?

in my app i use the code below to open up the downloads and only see PDF files. 在我的应用程序中,我使用下面的代码打开下载内容,仅查看PDF文件。 But it opens up the default Android file manager and for other parts of my app to work i need to use other file managers (i am using ES File Manager) to open up instead. 但这会打开默认的Android文件管理器,而要使我的应用程序的其他部分正常工作,我需要使用其他文件管理器(我正在使用ES File Manager)来打开。

How do i open up other file manager apps? 如何打开其他文件管理器应用程序?

(giving the user an option to choose from multiple file manager apps helps too) (为用户提供从多个文件管理器应用程序中选择的选项也有帮助)

My code as of now: 截至目前我的代码:

public void PDF() {
    PDF = (Button) findViewById(R.id.FindPDFBtn);//Finds the button in design and put it into a button variable.
    PDF.setOnClickListener(//Listens for a button click.
            new View.OnClickListener() {//Creates a new click listener.
                @Override
                public void onClick(View v) {//does what ever code is in here when the button is clicked

                    Intent intent = new Intent();
                    intent.setType("application/pdf");
                    intent.setAction(Intent.ACTION_GET_CONTENT);
                    startActivityForResult(Intent.createChooser(intent, "Select a PDF "), SELECT_PDF);

                }
            }
    );
}

The problem with third party file explorers is that most of them don't support the same kind of intents (as they are not standardized). 第三方文件浏览器的问题在于它们中的大多数不支持相同类型的意图(因为它们不是标准化的)。

For ES File explorer, check this: http://www.estrongs.com/res/develop_en.htm 对于ES File Explorer,请检查以下内容: http : //www.estrongs.com/res/develop_zh.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM