Sorry, sendIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/
mysong.mp3");
should be sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///
sdcard/mysong.mp3"));
but it doesn't change the result.On Jun 30, 2:39 pm, quill <[email protected]> wrote: > I just copy the code fromhttp://www.openintents.org/en/node/121to > test if I can send .txt or .mp3 file as email attachment, > Intent sendIntent = new Intent(Intent.ACTION_SEND); > sendIntent.setType("audio/mp3"); > sendIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3"); > sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject"); > startActivity(Intent.createChooser(sendIntent, "Title:")); > > But I got an error said that No applications can perform this action. > My android sdk is cupcake1.5, and I have already set up my gmail > acount in Email application. > Anyone knows why? If I set the type as "*/*"(sendIntent.setType("*/ > *");), it can launch the Email activity but with no attachment. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

