Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/178.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android上显示邮件中的图像_Android_Android Image - Fatal编程技术网

如何在android上显示邮件中的图像

如何在android上显示邮件中的图像,android,android-image,Android,Android Image,在我的android应用程序中,我需要截屏并在邮件中共享截屏(截屏显示为邮件) 我通过以下代码进行了屏幕截图: view = (LinearLayout)findViewById(R.id.screen); ......... View v1 = view.getRootView(); System.out.println("Root View : "+v1); v1.setDrawingCacheEnabled(true); Bitmap bm = v1.getDrawingCach

在我的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

你什么意思<代码>在邮件中显示屏幕截图?将图像保存到文件并作为附件发送:S?如何保存它,我需要在邮件部分显示而不是作为附件。请帮助我。它无法工作。。。就像保存图像一样简单,我从“”获得代码。并尝试了,但图像没有正确存储。我需要在电子邮件正文。请帮助我。为了保存图像,我从“”获取代码。并尝试了,但图像没有正确存储。你的代码显示作为附件的图像,但我需要在电子邮件正文。请帮帮我。
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:"));