Load a file from external storage to Inputstream

时光怂恿深爱的人放手 提交于 2019-11-30 01:22:58
Gabe Sechan

Try

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

Then you can read from the stream.

Satya
String fileName = "OfflineMap/maps.xml";
String path = Environment.getExternalStorageDirectory()+"/"+fileName;
File file = new File(path);
FileInputStream fileInputStream = new FileInputStream(file);
Mobeen Altaf
soundFile = openFileInput(uri);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!