Reputation: 6462
My app saves a file in the default downloads folder. Which is determined by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
.
Now I want open thee default Android Downloads Activity or App, so the user sees the downloads folder with my new file.
Upvotes: 1
Views: 1176
Reputation: 104
Please try this method.
public void openFolder() {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Uri uri = Uri.parse(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS));
intent.setDataAndType(uri, "resource/folder");
startActivity(Intent.createChooser(intent, "Open folder"));
}
Upvotes: 1
Reputation: 20258
I believe this is the code you are looking for:
Intent intent = new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS);
startActivity(intent);
Upvotes: 2
Reputation: 20346
I guess you need DownloadManager.ACTION_VIEW_DOWNLOADS
Intent viewDownloadsIntent = new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS);
startActivity(viewDownloadsIntent);
Upvotes: 2