Help Center> Meeting> Client SDK Reference> Android SDK> API Reference> UI Customization> Customizing a Screen for Adding Participants to a Meeting
Updated on 2023-03-23 GMT+08:00

Customizing a Screen for Adding Participants to a Meeting

When you touch the Invite button in the upper right corner of the participant list, the doAddAttendees callback method is triggered. You can customize the method, select contacts to be added to the meeting, and return the selected contact list via onSuccess of the callback.

Application Scenarios

Your application has integrated a corporate directory and you need to customize the function of adding contacts to a meeting.

Precautions

1. sdkConfig takes effect only when this configuration is passed during SDK initialization.

API for customizing the function of adding contacts to a meeting:

sdkConfig.setAddAttendeesHandle(new CustomAddAttendeesHandle());

The following figure shows the effect.

Sample code of customizing the method of adding participants

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Inject the screen for adding participants. The screen of selecting participants is displayed in the method.
public class CustomAddAttendeesHandle implements IAddAttendeesHandle {
     private HwmCallback<List<AttendeeModel>> callback;    
     /**
      * Activity called by the curActivity.
      * selectedAccount: indicates the selected account.
      * isScheled: specifies whether to schedule a meeting.
      * callback: After the participant is added, the list of selected participants is returned.
      **/
     @Override    
     public void doAddAttendees(Activity curActivity, List<AttendeeModel> selectedAccount, String selectParam, boolean isScheled, HwmCallback<List<AttendeeModel>> callback) {
          callback = hwmCallback;        
          // You can pass the selected participant list to facilitate operations on the custom screen.
          Intent intent = new Intent(Utils.getApp(), AddPeopleByAppidAuthActivity.class);                     
          activity.startActivityForResult(intent,5000);    
      }
     @Override    
     public void dealContactSelect(Intent intent) {    
     }
     @Override    
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
          if (requestCode == 5000){
              if(null != callback){
                  // Callback returned if the selected participant joins the meeting.
                  callback.onSuccess(DemoUtil.selectModels);            
              }        
          }    
     }
}

Sample code of processing the custom screen of adding participants to a meeting. AddPeopleByAppidAuthActivity is a custom screen example.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Add the participant logic to the click event of the button for adding participants in activity and pass the participant list to the custom handle.
        public void onClick(View view) {
            String thirdAccountId = thirdAccountIdTextView.getText().toString();
            String sipNumber = sipNumberTextView.getText().toString();
            String phoneNumber = userPhoneTextView.getText().toString();
            // The display name is optional. If it is left empty, the display name in the corporate directory is used.
            String name = userNameTextView.getText().toString();

            members = new ArrayList<>();
            // Select one of the three methods. The ID of the third-party address book is valid only for app ID login.
            if (!TextUtils.isEmpty(thirdAccountId)) {
                AttendeeModel attendeeModel = AttendeeModel.buildAttendeeByThirdUserId(thirdAccountId, name);
                members.add(attendeeModel);
            } else if (!TextUtils.isEmpty(sipNumber)) {
                // Select one of the three methods. The SIP number is the account identifier of the meeting corporate directory.
                AttendeeModel attendeeModel = AttendeeModel.buildAttendeeBySipNumber(sipNumber,name);
                members.add(attendeeModel);
            } else if (!TextUtils.isEmpty(phoneNumber)) {
                // Select one of the three methods. If a mobile number is specified, the outgoing call permission is required.
                AttendeeModel attendeeModel = AttendeeModel.buildAttendeeByPhone(phoneNumber, name);
                members.add(attendeeModel);
            } else {
                DemoUtil.showToast("Select one of the three methods for joining a meeting.");
                return;
            }

            DemoUtil.selectModels = members;
            Intent intent = new Intent();
            setResult(1,intent);
            finish();
        }