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