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

Sending audio file with android intent

$
0
0

Hi all,

i would like to send or share a audio file from my app to other apps like Facebook, Mail etc.

This is what i've got:

function share(e){
    var soundName = e.source.sound;
    var soundUrl = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'sounds/' + soundName + '.mp3');
 
 
    var intent = Titanium.Android.createIntent({
            action: Titanium.Android.ACTION_SEND,
            type: 'audio/mp3'
        });   
 
    intent.putExtraUri(Titanium.Android.EXTRA_STREAM, soundUrl);
    Titanium.Android.currentActivity.startActivity(Titanium.Android.createIntentChooser(intent,'Share'));
}
Now it sends an "[object File]" instead of the mp3 file. What i have to do to send the mp3 file? I'm using Titanium SDK 4.0.0.GA

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>