Reputation: 8742
I am using this code to download a file from my Activity. It downloads the file correctly on emulator and shows the downloading in notification too. But when i click on notification it just goes off.
String url = "http://developer.android.com/shareables/training/ActivityLifecycle.zip";
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri u = Uri.parse(url);
intent.setData(u);
startActivity(intent);
I need to store the path of this downloaded file.
Thanks in advance...:)
Upvotes: 0
Views: 693
Reputation: 28726
I think the locations of files downloaded by web browser is left to web browser discretion (no obligation to publish it). So I think the best you can do is changing your strategy :
first download the file. This question explain how to do it : Download a file with Android, and showing the progress in a ProgressDialog
then launch your ACTION_VIEW intent, but pass the uri of the just downloaded file instead of the external url
Upvotes: 1