Hi,
This a part of my code for sending e-mail message. But when I run it on Motorola Droid it crashed with error: "Sorry! The application Gmail (process com.google.android.gm) has stopped unexpectedly. Please try again."
May be somebody knows what a problem?Code:final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType("*/*"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ address }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subj"); ArrayList<File> flist = new ArrayList<File>(); try { for (int i = 0; i < contacts.size(); i++){ MyData c = data.get(i); File f; f = File.createTempFile(c.name, ".dta"); c.writeToFile(f); emailIntent.putExtra(android.content.Intent.EXTRA_STREAM, f.toURI()); flist.add(f); } } catch (IOException e) { e.printStackTrace(); } context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
Thanks


LinkBack URL
About LinkBacks
Reply With Quote