Updated on 2025-05-29 GMT+08:00

Customizing the Profile Picture

API Description

This API is used to customize the profile picture displayed after login.

Scenarios
Figure 1 PiP view

Figure 2 Gallery view

Figure 3 Participant list in a meeting

Figure 4 Mini window

Precautions

The profile picture of a user who has not logged in cannot be customized.

Method Definition

1
public Bitmap queryContactAvatar(ContactInfo contactInfo)

Parameter Description

Table 1 ContactInfo parameter description

Parameter

Type

Description

account

String

This parameter is preferentially used in the account and password login scenario.

thirdUserId

String

This parameter is preferentially used in the app ID login scenario.

sipNumber

String

This parameter is preferentially used in the cross-enterprise scenario.

orgId

String

Enterprise ID.

Return Values

Table 2

Parameter

Type

Description

bitmap

Bitmap

Bitmap class of the profile picture.

Sample Code
sdkConfig.setQueryContactAvatarStrategy(new IQueryContactAvatarStrategy() {
    @Override
    public Bitmap queryContactAvatar(ContactInfo contactInfo) {
        String extendedField = contactInfo.getExtendedField();
        HCLog.i(TAG, "setQueryContactInfoStrategy account: " + StringUtil.formatString(contactInfo.getAccount())
            + " thirdUserId: " + StringUtil.formatString(contactInfo.getThirdUserId())
            + " sipNumber: " + StringUtil.formatString(contactInfo.getSipNumber())
            + " extendedField: " + StringUtil.formatString(extendedField)
            + " realNameAccount : " + StringUtil.formatName(contactInfo.getRealNameAccount()));
        // When a third party queries the address book, the profile picture of the corresponding user is returned. In the sample code, a default picture is returned.
        return BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher);
    }
});