2016-03-20 11 views
0

私のアプリでは、以下のコードを使用してダウンロードを開き、PDFファイルのみを表示します。しかし、それはデフォルトのAndroidファイルマネージャを開き、私のアプリの他の部分では、私は別のファイルマネージャ(私はESファイルマネージャを使用している)を使用して、代わりに開く必要があります。私は他のファイルマネージャアプリを開くにはどうすればよい他のファイルマネージャーアプリをインテントで開く方法

?今のよう

(ユーザーが複数のファイルマネージャーアプリの中から選択するオプションを与えることがあまりにも役立ちます)

マイコード:

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); 

       } 
      } 
    ); 
} 

答えて

0

サードパーティのファイルの探検家との問題はのほとんどです彼らは(標準化されていないので)同種のインテントをサポートしていません。

ESファイルエクスプローラの場合:http://www.estrongs.com/res/develop_en.htm

関連する問題