Guest User

Untitled

a guest
Jul 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. File jfile = new File("file://android_asset/"+filename); //tried to get the URI of the assets folder
  2. JarFile file = new JarFile("assets/"+filename); //tried assuming the assets folder is root
  3. fd = am.openNonAssetFd( filename); //tried getting my file as an non asset in the assets folder (n.b. it is definitely there)
  4. fs = am.open(filename, AssetManager.ACCESS_BUFFER); //tried loading it as an asset
  5.  
  6. String fullfilename = "file:///android_asset/"+filename;
  7. File jfile = new File(fullfilename);
  8. if (jfile.exists())
  9. {
  10. return new FileInputStream(jfile);
  11. }
  12. else
  13. {
  14. return null; //the file does exist but it always says it doesn't.
  15. }
  16.  
  17. File jfile = new File("file:///android_asset/"+filename);
Add Comment
Please, Sign In to add comment