0

in my android app i need to take screen capture and share the captured screen in mail(captured screen to be shown mail).

i did screen capture by the following code:

view = (LinearLayout)findViewById(R.id.screen);
......... 

View v1 = view.getRootView();

System.out.println("Root View : "+v1);

v1.setDrawingCacheEnabled(true);

Bitmap bm = v1.getDrawingCache();

System.out.println("Bitmap : "+bm);

iv.setImageBitmap(bm);

this take the screen short and show the image in ImageView. i do not know how to display the screen capture in mail and where the image is stored. please help me.

Log cat : i get the following

08-01 12:40:40.640: INFO/System.out(3115): Bitmap : android.graphics.Bitmap@44f0c508

M.A.Murali
  • 9,988
  • 36
  • 105
  • 182

1 Answers1

0
Intent emailIntent = new Intent(Intent.ACTION_SEND);
Uri U=Uri.parse("file:///sdcard/logo.png");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,"sivafarshore@yahoo.com");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Test");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "This is email's message");
emailIntent.setType("image/png");
emailIntent.putExtra(android.content.Intent.EXTRA_STREAM,U);
startActivity(Intent.createChooser(emailIntent, "Email:"));
kannappan
  • 2,250
  • 3
  • 25
  • 35
  • for save image i get code from "http://stackoverflow.com/questions/649154/android-bitmap-save-to-location". and tried that but image not stored properly. and your code show the image as attachment but i need in email body. please help me. – M.A.Murali Aug 01 '11 at 07:58