3

How to create java.io.File class from file inside assets ? I have face.jpg in /assets/images/ and I need File to put in call of another function. How to achieve this ?

Damir
  • 54,277
  • 94
  • 246
  • 365
  • 3
    Possible duplicate to: http://stackoverflow.com/questions/4789325/android-path-to-asset-txt-file – fyr Dec 19 '11 at 14:27

1 Answers1

4

How to create java.io.File class from file inside assets ?

You don't, unless you copy the file from assets to a local file. Assets are not files in the filesystem, and so you cannot create File objects representing them.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491