2012-11-01 140 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

相關問題