如何在android中使用图像共享文本的意图?

问题描述:

我想通过意向与文本共享图像。不是图像整体或文本differtent。看,这是我的代码:如何在android中使用图像共享文本的意图?

Uri imageUri = Uri.parse("android.resource://" + getPackageName() 
     + "/drawable/app_icon"); 

String shareTxt = "Hey, now this is image "+ imageUri + " text."; 

Intent shareIntent = new Intent(); 
shareIntent.setAction(Intent.ACTION_SEND); 
shareIntent.putExtra(Intent.EXTRA_TEXT, shareTxt); 
shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri); 
shareIntent.setType("image/*"); 
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 
startActivity(Intent.createChooser(shareIntent, "Share")); 

输出:我需要:“文字图像文本”

但实际上出来把这个:形象整体低于文字的到来。

所以,android的人帮助我。

我大量的搜索,并最终找到了解决方案这是编码字符串放,并获得图像与文本和共享。所以非常感谢我。

查看此链接并获取图像字符串的编码格式。 http://www.fileformat.info/info/unicode/char/2702/index.htm