简体   繁体   English

重命名从Webview android下载

[英]Renaming a download from webview android

im using a webview with 7digital store to allow my users to buy and download mp3 onto their device. 即时通讯使用带有7digital商店的网络视图,允许我的用户购买mp3并将其下载到其设备上。

but now when i download a song from 7digital the song will get called -3.bin, -4.bin, -5.bin etc. 但是现在当我从7digital下载一首歌曲时,该歌曲将被称为-3.bin,-4.bin,-5.bin等。

How do i overwrite this name to the name of the song they are downloading? 如何将此名称覆盖为他们正在下载的歌曲的名称?

this is my code: 这是我的代码:

wv.setDownloadListener(new DownloadListener() {
        public void onDownloadStart(String url, String userAgent,
                String contentDisposition, String mimetype,
                long contentLength) {





           Intent intent = new Intent(Intent.ACTION_VIEW);
           intent.setData(Uri.parse(url));
           startActivity(intent);

        }
    });

new File("oldPath").renameTo(new File("newPath")); new File(“ oldPath”)。renameTo(new File(“ newPath”)));

Best regards. 最好的祝福。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM