what the issue at that code at android i want to save image at gallery
var img = $.photo_container.toImage().media; fileToShare = Titanium.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory, 'lactacyd_image' + moment() + '.jpg'); fileToShare.write(img); Titanium.Media.saveToPhotoGallery(fileToShare.write(img),{ success: function(e) { Titanium.UI.createAlertDialog({ title:'Photo Gallery', message:'Image Saved Successfully' }).show(); }, error: function(e) { Titanium.UI.createAlertDialog({ title:'Error saving', message:e.error }).show();