开发者

how to display image in mail on android

开发者 https://www.devze.com 2023-03-25 12:39 出处:网络
in my android app i need to take screen capture and share the captured screen in mail(captured screen to be shown mail).

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 : androi开发者_运维问答d.graphics.Bitmap@44f0c508


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:"));
0

精彩评论

暂无评论...
验证码 换一张
取 消