How to get the Uri of a image stored on the SDCARD?

前端 未结 2 883
无人及你
无人及你 2021-01-04 09:57

I need to get the URI of a image stored on the SDCARD.

When i want to get the Uri of a image stored on drawable, i use this and it works perfect:

i.p         


        
2条回答
  •  孤独总比滥情好
    2021-01-04 10:48

    String filename = "image.png";
    String path = "/mnt/sdcard/" + filename;
     File f = new File(path);  //  
                Uri imageUri = Uri.fromFile(f);     
    

提交回复
热议问题