0

在我的 android 应用程序中,我需要截屏并在邮件中共享截屏(截屏以显示邮件)。

我通过以下代码进行了屏幕截图:

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);

这会使屏幕变短并在 ImageView 中显示图像。我不知道如何在邮件中显示屏幕截图以及图像的存储位置。请帮我。

日志猫:我得到以下信息

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

4

1 回答 1

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:"));
于 2011-08-01T07:30:48.720 回答