2016-01-30 67 views
0

嗨我正在嘗試使用面料庫內的TweetComposer來發布照片。然而,一旦Twitter的意圖被要求,Twitter崩潰無論提供什麼錯誤信息。我希望其他人也有類似的經歷?這是我正在使用的代碼。從Android分享照片到twitter

File newFile = new File(getContext().getFilesDir(), "snapshot.jpg"); 
     try { 
      FileOutputStream fos = new FileOutputStream(newFile); 
      b.compress(Bitmap.CompressFormat.JPEG,50,fos); 
      fos.close(); 
     } 
     catch(Exception e) 
     { 

     } 

TweetComposer.Builder builder = new TweetComposer.Builder(getActivity()).text("TWEEEET") 
     .image(Uri.fromFile(newFile)); 
     builder.show(); 

它不工作,當我不添加圖像!

Twitter在添加圖像時呈現不支持的介質錯誤。

謝謝!

回答

0

對,我設法解決它!原來我試圖分享一個回收的位圖!

相關問題