i want create sub directory non-private under environment.directory_pictures directory. used code shown below of no avail. directory created remains private. don't know i'm wrong.
file file = new file(environment.getexternalstoragepublicdirectory(environment.directory_pictures), "myimages"); file.mkdirs(); file f = new file(file,"image1");
first, have not created file, @ least in code shown above. have created java file object, , created directory, did not create file image1, , directory empty. know of no way force empty directory picked anything, though should see if use adb shell or ddms examine device.
when write file directory, sure call getfd().sync() on fileoutputstream before close() stream. then, use mediascannerconnection , static scanfile() method have newly-created file indexed mediastore. until this, newly-created file not visible via mtp or many third-party apps.
Comments
Post a Comment