简体   繁体   English

如何在Android中查找通过网络浏览器下载的文件

[英]How to find the file downloaded by web browser in Android

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...:) 提前致谢...:)

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 : 因此,我认为您能做的最好的就是更改策略:

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

相关问题 android如何从下载的文件中查找版本号以进行FOTA更新 - android how to find version number from file downloaded for FOTA update APK文件无法在android浏览器中完全下载,但可以从同一Web服务器在PC中成功下载吗? - APK file cannot be downloaded completely in android browser ,but can be download successfully in PC from my same web server? Android 如何通过网络浏览器强制下载文件 - Android how to force download the file by web browser 如何检测在Android中下载的文件 - How to detect File downloaded in android 如何在Android中重命名下载的文件 - How to rename downloaded file in android 当任何浏览器在android上保存文件时,是否发送了广播? 如何在Android的浏览器中拦截保存/下载的文件? - When any browser saves a file on android, is there a broadcast sent? How can I intercept saved/downloaded files in a browser on Android? 如何找到地图下载成功? [android] - How to find that the map was downloaded successfully? [android] Android Web View下载的文件“无法打开文件”消息 - Android Web View Downloaded File “Can't Open File” Message Android:如何参考DownloadManager下载的文件 - Android: How to refer to the file downloaded by DownloadManager 如何以编程方式在Android中打开下载的文件? - How to open downloaded file in Android programatically?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM