Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Allow participants to raise their hand to get attention during calls. This feature is useful for large meetings, webinars, or any scenario where participants need to signal they want to speak.
Raise Hand
Signal that you want to speak or get attention:
val callSession = CallSession.getInstance()
callSession.raiseHand()
CallSession callSession = CallSession.getInstance();
callSession.raiseHand();
Lower Hand
Remove the raised hand indicator:
val callSession = CallSession.getInstance()
callSession.lowerHand()
CallSession callSession = CallSession.getInstance();
callSession.lowerHand();
Listen for Raise Hand Events
Monitor when participants raise or lower their hands using ParticipantEventListener:
val callSession = CallSession.getInstance()
callSession.addParticipantEventListener(this, object : ParticipantEventListener() {
override fun onParticipantHandRaised(participant: Participant) {
Log.d(TAG, "${participant.name} raised their hand")
// Show notification or visual indicator
showHandRaisedNotification(participant)
}
override fun onParticipantHandLowered(participant: Participant) {
Log.d(TAG, "${participant.name} lowered their hand")
// Remove notification or visual indicator
hideHandRaisedIndicator(participant)
}
// Other callbacks...
override fun onParticipantJoined(participant: Participant) {}
override fun onParticipantLeft(participant: Participant) {}
override fun onParticipantListChanged(participants: List<Participant>) {}
override fun onParticipantAudioMuted(participant: Participant) {}
override fun onParticipantAudioUnmuted(participant: Participant) {}
override fun onParticipantVideoPaused(participant: Participant) {}
override fun onParticipantVideoResumed(participant: Participant) {}
override fun onParticipantStartedScreenShare(participant: Participant) {}
override fun onParticipantStoppedScreenShare(participant: Participant) {}
override fun onParticipantStartedRecording(participant: Participant) {}
override fun onParticipantStoppedRecording(participant: Participant) {}
override fun onDominantSpeakerChanged(participant: Participant) {}
})
CallSession callSession = CallSession.getInstance();
callSession.addParticipantEventListener(this, new ParticipantEventListener() {
@Override
public void onParticipantHandRaised(Participant participant) {
Log.d(TAG, participant.getName() + " raised their hand");
// Show notification or visual indicator
showHandRaisedNotification(participant);
}
@Override
public void onParticipantHandLowered(Participant participant) {
Log.d(TAG, participant.getName() + " lowered their hand");
// Remove notification or visual indicator
hideHandRaisedIndicator(participant);
}
// Other callbacks...
});
Check Raised Hand Status
The Participant object includes a raisedHandTimestamp property to check if a participant has their hand raised:
callSession.addParticipantEventListener(this, object : ParticipantEventListener() {
override fun onParticipantListChanged(participants: List<Participant>) {
val raisedHands = participants.filter { it.raisedHandTimestamp > 0 }
.sortedBy { it.raisedHandTimestamp }
// Display participants with raised hands in order
updateRaisedHandsList(raisedHands)
}
})
callSession.addParticipantEventListener(this, new ParticipantEventListener() {
@Override
public void onParticipantListChanged(List<Participant> participants) {
List<Participant> raisedHands = new ArrayList<>();
for (Participant p : participants) {
if (p.getRaisedHandTimestamp() > 0) {
raisedHands.add(p);
}
}
// Sort by timestamp and display
Collections.sort(raisedHands, (a, b) ->
Long.compare(a.getRaisedHandTimestamp(), b.getRaisedHandTimestamp()));
updateRaisedHandsList(raisedHands);
}
});
To disable the raise hand feature, hide the button in the call UI:
val sessionSettings = CometChatCalls.SessionSettingsBuilder()
.hideRaiseHandButton(true)
.build()
SessionSettings sessionSettings = new CometChatCalls.SessionSettingsBuilder()
.hideRaiseHandButton(true)
.build();