When I call this :
File directory = new File("file:///android_asset/");
then this :
directory.isDirectory()
Always returns false
.
Am I doing something wrong here ? (Sorry if it is a dumb question)
Edit: I store several images in the assets
folder and I wanted to load them in my app (like an image gallery).
Call
directory.mkdirs();
after you created the File
object
Edit: in your case try to change file url as below:
new File("/mnt/external_sd/");
or find the true path by looking it in eclipse File explorer.. do not start it with file://
May be you are searching for this:
String fullPath = "/data/data/" + this.getPackageName() + "/" + path;
File dir = new File(fullPath);
if (!dir.exists())
dir.mkdir();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.