Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Ti.Media.Android.scanMediaFiles for Absolute Path

$
0
0

Hi, i have this code :

var imgPath = 'file:///sdcard/MyMobileProject/Images/Resize/';
var imgDir = Titanium.Filesystem.getFile(imgPath);
 
if (!imgDir.exists()){
    imgDir.createDirectory();
}
 
var f = Titanium.Filesystem.getFile(imgPath, filename);
f.write(image);
 
Titanium.Media.Android.scanMediaFiles([f.nativePath], ["image/jpeg"]);
When i try to do a mediaScan with relative path such as :

var imgPath = Titanium.Filesystem.externalStorageDirectory + '/Resize/';

It works perfectly, but after i changed the path into an absolute path, it won't works for me.. The device is creating new file on the absolute path, but my windows explorer can't find that file because scanMediaFiles function won't work in this case..

Does anyone know how to do a scanMediaFiles with an absolute path? so i can get the image that created by my app from windows explorer.. Thanks..


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>