0

我正在尝试使用 AddThis.shareItem(this,"facebook",mShareTitle,mShareDescription,myBitmap); 但我不断收到 1MB 缓冲区错误“FAILED BINDER TRANSACTION !!!” 或 Facebook“错误稍后再试”。

有人知道避免这种情况的方法吗?(也许在共享位图之前清理缓冲区?)。

除了 AddThis.shareItem(this,"facebook",mShareTitle,mShareDescription,myBitmap); 之外,所有代码都可以正常工作 部分。

谢谢!

String imageURL= " "; //contains the path of the image on device
File imgFile = new  File(imageURL);


if(imgFile.exists()){
            Log.d(TAG, "imgFile.getAbsolutePath() " + imgFile.getAbsolutePath());
            Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());try {

                    //This is what I found in http://support.addthis.com/ and works everywhere except on facebook
                    AddThis.shareItem(this, "facebook",mShareTitle,mShareDescription,myBitmap);                 
                    //Sharing from web works fine
                    AddThis.shareItem(this, "facebook", "http://example.jpg" , mShareTitle, mShareDescription);
                    //I've tried this but it's not working 
                    AddThis.shareItem(this, "facebook", "imgFile.getAbsolutePath()", mShareTitle, mShareDescription);
                    //I've read something about avoid buffer using Uris, but I'm not doing it appropiately
                    AddThis.shareItem(this, "facebook", "Uri.fromFile(imgFile).getPath()", mShareTitle, mShareDescription);
                    //I've read something about avoid buffer using Uris, but I'm not doing it appropiately
                    AddThis.shareItem(this, "facebook", imageURL, mShareTitle, mShareDescription);
                    //Last try that doesn't work
                    String foo = "file://";
                    foo = foo.concat(imgFile.getAbsolutePath());
                    Log.d(TAG,"foo: "+foo);
                    Log.d(TAG,"imageURL: "+imageURL);
                    AddThis.shareItem(this, "facebook", "foo", mShareTitle, mShareDescription);                 

                } catch (ATDatabaseException e) {
                    e.printStackTrace();
                    Log.e(TAG, "ATDatabaseException: " + e);
                } catch (ATSharerException e) {
                    e.printStackTrace();
                    Log.e(TAG, "ATSharerException: " + e);

                }

            }
            else
                Log.d(TAG, "Image not found");

        }   
4

0 回答 0