Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

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 ?

like image 329
Damir Avatar asked Mar 03 '26 02:03

Damir


1 Answers

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.

like image 191
CommonsWare Avatar answered Mar 05 '26 16:03

CommonsWare