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
  • 51,611
  • 92
  • 240
  • 358
  • 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
  • 954,112
  • 185
  • 2,315
  • 2,367