Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-1510

Android: Add support for saveToPhotoGallery (Titanium.Media.saveToPhotoGallery)

    Details

      Description

      Currently only a log warning that it's not supported.</p></div>

      {html}

      The code sample below demonstrates the feature required. Works fine on iphone.

      "app.js"

       
      // this sets the background color of the master UIView (when there are no windows/tab groups on it)
      Titanium.UI.setBackgroundColor('#000');
       
      var win1 = Titanium.UI.createWindow({  
       
          backgroundColor:'#fff'
      });
       
      var image_view = Ti.UI.createImageView({
      		image: 'appcelerator.png',
      		height: 400,
      		width: 320
      	});
       
       var button2 =  Ti.UI.createButton({
       	top:90,
       	title:'save to gallery',
       	height:40
       	
       });	
       
       win1.add(button2);
      	button2.addEventListener('click', function(e){	
      		win1.add(image_view);
      		var img = image_view.toBlob();
      		Titanium.Media.saveToPhotoGallery(img,{
      			"success": function(e){
      				alert('Saved to your camera roll.');	
      			},
      			"error": function(e){
      				alert(e.error);
      			}
      		});			
      	});
      	
      win1.open();
      
      

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              billdawson Bill Dawson
              Reviewer:
              Hieu Pham
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration