Paste
Pasted as Plain Text by Giridharan.jeeva ( 12 years ago )
final Intent emailIntent = new Intent(
android.content.Intent.ACTION_SEND);
//
// String address = "asd@gmail.com";
String subject = "Report";
String emailtext = "Please check the attached report";
//
emailIntent.setType("email/text");
/*
* emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
* new String[] { address });-
*/
String fun = Environment.getExternalStorageDirectory()+"/Kalimba.mp3";
emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent.setType("audio/mp3");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,subject);
// emailIntent.putExtra(Intent.EXTRA_STREAM,URI);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,emailtext);
emailIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse("file://"+fun));
startActivity(android.content.Intent.createChooser(emailIntent,"Send mail..."));
Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_LONG).show();
} catch (Throwable t) {
Toast.makeText(getApplicationContext(), "error",
Toast.LENGTH_LONG).show();
};
Revise this Paste
Parent: 66088