2011-11-03 84 views

回答

0

这将帮助你

File myDir=new File("/sdcard/Download"); 
    myDir.mkdirs(); 
    String fname = "Image.jpg"; 
    File file = new File (myDir,fname); 
    try { 
     FileOutputStream out = new FileOutputStream(file); 
     finalBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); 
     // finalBitmap means sending image. 
     out.flush(); 
     out.close(); 
     Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
     emailIntent.setType("Image/jpg"); 
     emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Greetings"); 
     emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"Hi"); 
     File downloadedPic = new File(Environment.getExternalStoragePublicDirectory 
          (Environment.DIRECTORY_DOWNLOADS),"image.jpg"); 
     emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(downloadedPic)); 
     Full.this.startActivity(Intent.createChooser(emailIntent, "send")); 
    } catch (Exception e) {} 
相关问题