Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4937] Android: openPhotoGallery doesn't work for SDK 6.0.0 when selecting file from "downloads"

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2017-05-05T14:51:28.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterDavid Fox
AssigneeShak Hossain
Created2017-05-02T17:07:29.000+0000
Updated2017-05-05T14:51:28.000+0000

Description

Comments

  1. Sharif AbuDarda 2017-05-03

    Hello, I can't reproduce your issue with the below code
       var win = Titanium.UI.createWindow();
       
       var btn = Ti.UI.createButton({
       
           title : 'Open Gallery',
           top : 10
       
       });
       
       var imageView = Ti.UI.createImageView({
           top : 100,
           height : 200,
           weidth : 200
       });
       win.add(imageView);
       
       btn.addEventListener('click', function() {
       
           Ti.Media.openPhotoGallery({
       
               mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
       
               success : function(e) {
                   imageView.image = e.media;
       
       
               },
       
               cancel : function() {
               },
       
               error : function(e) {
       
                   Ti.API.error(JSON.stringify(e));
       
               }
           });
       
       });
       
       
       win.add(btn);
       
       
       win.open();
       
    I am testing on Android 6.0.1 device with 6.0.0.GA SDK. My CLI 6.2.0. Thanks.
  2. David Fox 2017-05-03

    It has to be directly from the "downloads" folder. If it's from another folder, even if the same file, ex "recent," then it will work correctly. You also need to do something to the file blob I think, as discussed in the other issue. Ex. try getting the length of the blob and it will fail
  3. Gary Mathews 2017-05-05

JSON Source