Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-19194] Android: Intent putExtraUri accepts a String array #7481

Merged
merged 1 commit into from Dec 1, 2015

Conversation

ashcoding
Copy link
Contributor

Jira: https://jira.appcelerator.org/browse/TIMOB-19194

You can test it by sending the image to the Google Drive app.
Test code App.js:-

var win = Ti.UI.createWindow({
});

var button1 = Titanium.UI.createButton({
   title: 'Press for Multiple Image',
   top: 10,
   height: 50
});

button1.addEventListener('click',function(e)
{

         Ti.Media.openPhotoGallery({
                success:function(event) {                    

                var intent = Ti.Android.createIntent({
                    action: Ti.Android.ACTION_SEND_MULTIPLE,
                    type:"image/*"
                });
                intent.putExtraUri(Ti.Android.EXTRA_STREAM, [event.media.nativePath, event.media.nativePath]);          
                var share = Ti.Android.createIntentChooser(intent, 'Sending image to');
                Ti.Android.currentActivity.startActivity(share);

                }
            });

});

var button2 = Titanium.UI.createButton({
   title: 'Press for Single Image',
   top: 90,
   height: 50
});

button2.addEventListener('click',function(e)
{

         Ti.Media.openPhotoGallery({
                success:function(event) {                    

                var intent = Ti.Android.createIntent({
                    action: Ti.Android.ACTION_SEND,
                    type:"image/jpg"
                });
                intent.putExtraUri(Ti.Android.EXTRA_STREAM, event.media.nativePath);            
                var share = Ti.Android.createIntentChooser(intent, 'Sending image to');
                Ti.Android.currentActivity.startActivity(share);

                }
            });

});

win.add(button1);
win.add(button2);

win.open();

@hieupham007
Copy link
Contributor

Code reviewed and functionally tested. Request accepted

hieupham007 added a commit that referenced this pull request Dec 1, 2015
[TIMOB-19194] Android: Intent putExtraUri accepts a String array
@hieupham007 hieupham007 merged commit 785638b into tidev:master Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants