2012-11-01 136 views
1

大家好,我需要一些帮助。我有一个android应用程序,它是一个gallary,当他们选择图像时,你可以按菜单共享,它会去一个文本框和一些引号,他们可以选择一个报价或写自己的文本,然后选择他们想分享的地方至。Android图像共享应用程序

我的问题是,当我尝试分享到Facebook或彩信时,它只显示文本并说“无法附加。文件不支持”。但是当我选择与gmail共享时,它具有文本和图像,并且一切都很好。

我只是想知道如果有人有任何想法如何解决这个问题,如果有的话可以告诉我怎么做。

在先进的感谢,

扎克

回答

1

你分享六一Intent.createChooser(),使用官方的Facebook应用程序?

官方的FB应用程序只允许你分享一个网址(www.example.com),它会在提交帖子之前从该网站获取图片和文本。

+0

这里是即时通讯使用(对不起,它是太长的一个评论)----> – Zach

+0

'位图resourceImage = BitmapFactory.decodeResource(this.getResources(),selectedImage); 文件externalStorageFile = new File(Environment.getExternalStorageDirectory(),“image.jpg”); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); resourceImage.compress(Bitmap.CompressFormat.JPEG,100,bytes); byte b [] = bytes.toByteArray(); try { externalStorageFile.createNewFile(); OutputStream filoutputStream = new FileOutputStream(externalStorageFile); (b); filoutputStream.flush(); filoutputStream.close(); catch(IOException e){ e.printStackTrace(); ' – Zach

+0

'} 意图sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.setType(“text/plain”); sendIntent.putExtra(Intent.EXTRA_TEXT,message); sendIntent.putExtra(Intent.EXTRA_STREAM,Uri.parse(“file://”+ externalStorageFile.getAbsolutePath())); (Intent.createChooser(sendIntent, )context.getResources()。getString(R.string.text_share_title))); TextActivity.this.finish(); } }' – Zach

相关问题