Load a file from external storage to Inputstream

前端 未结 4 815
猫巷女王i
猫巷女王i 2020-12-25 11:47

i have a video file in my external directory. how can i load it to inputstream variable. For the time being i am reading file in the res/raw folder but i want to read it fro

4条回答
  •  情歌与酒
    2020-12-25 12:24

    Try

    File file = new File(Uri.toString());
    FileInputStream fileInputStream = new FileInputStream(file);
    

    Then you can read from the stream.

提交回复
热议问题