Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. try {
  2. File myFile = new File(android.os.Environment.getExternalStorageDirectory() + fileName);
  3.  
  4. BufferedInputStream buf = new BufferedInputStream(new FileInputStream(myFile));
  5. buf.read(buffer, 0, buffer.length);
  6. buf.close();
  7. } catch (FileNotFoundException e) {
  8. Toast.makeText(getApplicationContext(),"File Not Found"+fileName,Toast.LENGTH_LONG).show();
  9. e.printStackTrace();
  10. } catch (IOException e) {
  11. Toast.makeText(getApplicationContext(),"IOException",Toast.LENGTH_LONG).show();
  12. e.printStackTrace();
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement