Android Facebook SDK Progress Bar during upload

喜欢而已 提交于 2019-12-02 05:51:31

问题


I am trying out the FB SDK and I was wondering if it is possible to attach a progress bar while data is being uploaded.

This is a sample example on how FB tells us to do.

ByteArrayOutputStream bos = new ByteArrayOutputStream();
me.compress(Bitmap.CompressFormat.JPEG, 100, bos);
params.putByteArray("picture", bos.toByteArray());
mAsyncRunner.request("me/photos", params, "POST", new SampleUploadListener(), null);

The issue is that you are forced to use a byte array instead of an output stream which you could combine with a progress bar

One alternative I can imagine is to modify Utils.java from the FB SDK but I would rather like to ask if someone had success implementing a progress bar without massing around in the facebook sdk?


回答1:


I found a solution but it involved touching the facebook sdk.

Here is the modified code in Util.java.



来源:https://stackoverflow.com/questions/10440575/android-facebook-sdk-progress-bar-during-upload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!