Uploading a Profile Picture
1
|
HWMBizSdk.getBizOpenApi().uploadSelfAvatar(String path, HwmCallback<Void> hwmCallback) |
API Description
This API is used to upload a profile picture to the address book on the meeting server.
Precautions
1. Call this API only when you have logged in.
2. Upload a PNG or JPG image no more than 200 KB.
1 2 3 4 5 6 |
/** * Uploads your profile picture to the address book on the meeting server. * @param path Indicates the local path of the profile picture. * @param hwmCallback Indicates the callback of the profile picture setting result. */ void uploadSelfAvatar(String path, HwmCallback<Void> hwmCallback); |
Parameter Description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
path |
Yes |
String |
Local path of the profile picture. |
hwmCallback |
Yes |
HwmCallback<Void> |
Callback object. |
Return Values
None
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
HWMBizSdk.getBizOpenApi().uploadSelfAvatar(filepath, new HwmCallback<Void>() { @Override public void onSuccess(Void aVoid) { if (getActivity() != null) { ((DemoActivity) getActivity()).dismissLoading(); } DemoUtil.showToast("Profile picture set."); } @Override public void onFailed(int retCode, String desc) { if (getActivity() != null) { ((DemoActivity) getActivity()).dismissLoading(); } if (!TextUtils.isEmpty(desc)) { DemoUtil.showToast(desc); } else { DemoUtil.showToast("Failed to set the profile picture."); } } }); |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot