/sdcard/cats.jpg <- I know the absolute address of the image like this. How do I know the content URI of this file?
I even downloaded the image file from my code and saved it in a specific folder. If you want to read an image using the path where my file is currently stored in Image View, you can read it with bitmap, but it's too slow, so if you change this path to contenturi, it's faster and easier to import it with the method ImageView.setImageUri(uri), but I don't know how to change it to contenturi. Please let me know.
image android
ImageView.setImageURI(Uri.fromFile(new File("/sdcard/cats.jpg")));
This one
ImageView.setImageURI(Uri.parse(new File("/sdcard/cats.jpg").toString()));
Do it like this.
© 2024 OneMinuteCode. All rights reserved.