android - Mail attachment does not have correct Content-Type -


i want enable android app send file 1 device device in various ways (mail, bluetooth, whatever).

my first use case email. code i'm using generate send intent.

            intent shareintent = new intent();             shareintent.setaction(intent.action_send);             shareintent.settype("text/xml");             shareintent.putextra(intent.extra_stream, uri);             startactivity(intent.createchooser(shareintent, getresources().gettext(r.string.share_list))); 

when run on simulator (android 2.1), attachment section of resulting mail reads:

content-type: ; 

however, when run on galaxy nexus (android 4.2.2), attachment section reads:

content-type: application/tpl; 

this might because passed uri ends in .tpl.

this have expected:

content-type: text/xml; 

am missing here? important mail attachment has correct mime type can use intent filters receiving side of application.

i think referring web content types,

you should have type in case (email/message) i.settype("message/rfc822");

see post

i hope do..


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -