What is the easiest way to convert android.net.Uri to File?
final File file = new File(Environment.getExternalStorageDirectory(), "read.me");
Uri uri = Uri.fromFile(file);
File auxFile = new File(uri.toString());
assertEquals(file.getAbsolutePath(), auxFile.getAbsolutePath());
I tried it like this, but it didn't work.
file android uri file-uri
new File(uri.getPath());
This or
new File(uri.toString());
You can do it in this way.
© 2024 OneMinuteCode. All rights reserved.