Email sending error

Discussion in 'Android Hacks and Help' started by antaresm, Jul 26, 2010.

  1. antaresm
    Offline

    antaresm New Member

    Joined:
    Jul 26, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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."
    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..."));
    May be somebody knows what a problem?
    Thanks
Search tags for this page

htc incredible issues the process com.google.andriod.gm has