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

Android Intent attach image

$
0
0

Hey,

I have a bit of an issue when trying to attach an image to an MMS in android. It says the file type is not supported. Below is my code which i am using to attach the image

mms_btn.addEventListener('click', function()
    {
        var file = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory + "assets/share/"+Ti.App.randomimg+".jpg");
        intent = Ti.Android.createIntent({
            action: Ti.Android.ACTION_SEND,
            packageName: 'com.android.mms'
        });
        intent.setType('image/*');
        intent.putExtraUri(Titanium.Android.EXTRA_STREAM, file.getNativePath());
        intent.putExtra("sms_body","WOW, I got a " + Ti.App.result_text + "  see what you get?");
        Ti.Android.currentActivity.startActivity(intent);
 
    });
Does anybody know why this would be happening?

D


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>