How to save a media file (say .mp3) from an existing URI, which I am getting from an Implicit Intent?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You can do it using
Use this method, it works
When receiving a
android.net.Uri
from an external source, the best way to save the file is from the stream:createFileFromStream
method:I have used following code to save a file from an existing Uri given back from an Intent to an Uri that my App hosts:
1.Create a file from a URI path as:
2.Create another File where you want the file to save as:
3.Rename the file as:
With this the file from default path is automatically deleted and created at the new path.