Skip to main content
CometChatCallLogs displays the list of call logs for the currently logged-in user, showing caller names, avatars, call status, and timestamps.

When to use this

  • You need a screen that lists all incoming, outgoing, and missed calls for the logged-in user.
  • You want to show caller names, avatars, call type (audio/video), and call status for each entry.
  • You need tap and long-press actions on call log items (open details, delete, call back).
  • You want to filter call logs by type, status, direction, recording status, or specific user/group IDs.
  • You want to customize the call log list appearance with styles, custom views, or date formatters.

Prerequisites

  • CometChat SDK initialized with CometChatUIKit.init() and a user logged in.
  • The cometchat-chat-uikit-android dependency added to your project.
  • A valid layout_activity.xml or Activity/Fragment where you will place the component.

Quick start

  1. Open your layout_activity.xml file.
  2. Add the CometChatCallLogs XML element:
layout_activity.xml
<com.cometchat.chatuikit.calls.calllogs.CometChatCallLogs
    android:id="@+id/call_log"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
What this does: Adds the CometChatCallLogs component to your layout. It fills the available width and height and renders the call log list for the logged-in user.
  1. Build and run your app.
  2. Verify that the call log list appears with caller names, avatars, call status indicators, and timestamps.
  1. If you need to add the component programmatically instead of XML, see the Activity integration or Fragment integration subsections in Implementation.

Core concepts

  • CometChatCallLogs: The main component class that renders the call log list. It can be added via XML layout, Activity, or Fragment.
  • Actions: Callbacks such as setOnItemClick, setOnItemLongClick, and setOnBackPressListener that let you respond to user interactions.
  • Filters: Use CallLogRequest.CallLogRequestBuilder to filter call logs by limit, call type, call status, recording status, call direction, UID, GUID, call category, or auth token.
  • Events: The CometChatCallLogs component does not have any exposed events.
  • Style: XML theme styles (parent CometChatCallLogsStyle) applied via setStyle() to customize colors, fonts, and sub-component styles.
  • Advanced views: Methods like setLeadingView, setTitleView, setTrailingView, setItemView, and setSubtitleView that let you replace default UI elements with custom layouts.

Implementation

Activity integration

What you’re changing: How you add CometChatCallLogs to an Activity programmatically.
  • Where: Your Activity class (e.g., YourActivity.java or YourActivity.kt).
  • Applies to: CometChatCallLogs.
  • Default behavior: The component is not added until you set it as the content view.
  • Override: Create a CometChatCallLogs instance and call setContentView in onCreate.
  • Code:
YourActivity.java
CometChatCallLogs cometchatCallLogs;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    cometchatCallLogs = new CometChatCallLogs(this);

    setContentView(cometchatCallLogs);
}
What this does: Creates a new CometChatCallLogs instance and sets it as the entire content view of the Activity. The call log list renders immediately after the Activity is created.
  • Verify: The call log list fills the screen when the Activity launches.

Fragment integration

What you’re changing: How you add CometChatCallLogs to a Fragment.
  • Where: Your Fragment class (e.g., YourFragment.java or YourFragment.kt).
  • Applies to: CometChatCallLogs.
  • Default behavior: The component is not added until you return it from onCreateView.
  • Override: Create a CometChatCallLogs instance and return it from onCreateView.
  • Code:
YourFragment.java
CometChatCallLogs cometchatCallLogs;

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    cometchatCallLogs = new CometChatCallLogs(requireContext());

    return cometchatCallLogs;
}
What this does: Creates a new CometChatCallLogs instance and returns it as the Fragment’s root view. The call log list renders when the Fragment is displayed.
  • Verify: The call log list appears inside the Fragment’s container.

Actions

What you’re changing: How the component responds to user interactions such as taps, long-presses, back button, errors, load completion, and empty states.
  • Where: Activity or Fragment where you hold a reference to CometChatCallLogs (e.g., cometchatCallLogs).
  • Applies to: CometChatCallLogs.
  • Default behavior: Predefined actions execute automatically (e.g., tapping a call log item opens details, pressing back navigates to the previous screen).
  • Override: Call the corresponding setter method to replace the default behavior with your own logic.

setOnItemClick

Function invoked when a call log item is clicked, used to open a detailed chat screen.
YourActivity.java
cometchatCallLogs.setOnItemClick((view1, position, callLog) -> {
            
    });
What this does: Replaces the default item-click behavior. When a user taps a call log entry, your custom lambda executes instead of the built-in navigation.

setOnItemLongClick

Function executed when a call log item is long-pressed, allowing additional actions like delete or select.
YourActivity.java
cometchatCallLogs.setOnItemLongClick((view1, position, callLog) -> {

    });
What this does: Replaces the default long-press behavior. When a user long-presses a call log entry, your custom lambda executes.

setOnBackPressListener

Triggered when the user presses the back button in the app bar. By default, it navigates to the previous activity.
YourActivity.java
cometchatCallLogs.setOnBackPressListener(() -> {
            
    });
What this does: Overrides the default back-press navigation. When the user taps the back button, your custom logic runs instead.

setOnError

Listens for any errors that occur in the Call Logs component. This does not change the component’s behavior.
YourActivity.java
cometchatCallLogs.setOnError(cometchatException -> {

    });
What this does: Registers an error listener. If the component encounters an error (e.g., network failure), your callback receives the exception.

setOnLoad

Invoked when the list is successfully fetched and loaded, helping track component readiness.
YourActivity.java
cometchatCallLogs.setOnLoad(list -> {

});
What this does: Registers a callback that fires after the call log list is fetched and rendered. The callback receives the list of loaded CallLog objects.

setOnEmpty

Called when the list is empty, enabling custom handling such as showing a placeholder message.
YourActivity.java
cometchatCallLogs.setOnEmpty(() -> {
            
    });
What this does: Registers a callback that fires when the call log list has no items. Use this to show a custom empty-state message or trigger other logic.
  • Verify: After setting an action callback, trigger the corresponding user interaction (tap, long-press, back) and confirm your custom logic executes instead of the default behavior.

Filters

What you’re changing: Which call logs appear in the list.
  • Where: Activity or Fragment where you hold a reference to CometChatCallLogs.
  • Applies to: CometChatCallLogs.
  • Default behavior: All call logs for the logged-in user are fetched and displayed.
  • Override: Create a CallLogRequest.CallLogRequestBuilder, configure it, and pass it to setCallLogRequestBuilder.
You can filter using the following parameters:
PropertyDescriptionCode
LimitSets the limit for the call logs request.setLimit(int limit)
Call TypeSets the call type for the call logs request.setCallType(String callType)
Call StatusSets the call status for the call logs request.setCallStatus(String callStatus)
Has RecordingSets the recording status for the call logs request.setHasRecording(boolean hasRecording)
Call DirectionSets the call direction for the call logs request.setCallDirection(String callDirection)
UIDSets the user ID for the call logs request.setUid(String uid)
GUIDSets the group ID for the call logs request.setGuid(String guid)
Call CategorySets the call category for the call logs request.setCallCategory(String callCategory)
Auth TokenSets the auth token for the call logs request.setAuthToken(String authToken)
  • Code:
CallLogRequest.CallLogRequestBuilder callLogRequestBuilder = new CallLogRequest.CallLogRequestBuilder()
        .setLimit(20)
        .setHasRecording(true);

cometchatCallLogs.setCallLogRequestBuilder(callLogRequestBuilder);
What this does: Creates a CallLogRequestBuilder that filters call logs to show only entries with recordings, with a limit of 20 per fetch. The builder is then applied to the CometChatCallLogs component.
  • Verify: The call log list shows only call logs that have recordings and fetches at most 20 items per request.

Events

The CometChatCallLogs component does not have any exposed events.

Style

What you’re changing: The visual appearance of the Call Logs component using XML theme styles.
  • Where: themes.xml for style definitions, and your Activity/Fragment for applying the style.
  • Applies to: CometChatCallLogs.
  • Default behavior: The component uses the default CometChatCallLogsStyle.
  • Override: Define a custom style with parent CometChatCallLogsStyle in themes.xml, then call setStyle() on the component.
  • Code:
themes.xml
     <style name="CustomAvatarStyle" parent="CometChatAvatarStyle">
        <item name="cometchatAvatarStrokeRadius">8dp</item>
        <item name="cometchatAvatarBackgroundColor">#FBAA75</item>
    </style>

    <style name="CustomCallLogStyle" parent="CometChatCallLogsStyle">
        <item name="cometchatCallLogsSeparatorColor">#F76808</item>
        <item name="cometchatCallLogsTitleTextColor">#F76808</item>
        <item name="cometchatCallLogsAvatarStyle">@style/CustomAvatarStyle</item>
    </style>
What this does: Defines two custom styles: CustomAvatarStyle sets the avatar corner radius to 8dp and background color to #FBAA75; CustomCallLogStyle sets the separator color and title text color to #F76808 and applies the custom avatar style.
cometchatCallLogs.setStyle(R.style.CustomCallLogStyle);
What this does: Applies the CustomCallLogStyle theme to the CometChatCallLogs component, changing the separator color, title text color, and avatar appearance.
To know more such attributes, visit the attributes file.
  • Verify: The call log list separators and title text display in orange (#F76808), and avatars display with rounded corners (8dp radius) and an orange background (#FBAA75).

Functionality

What you’re changing: Small functional customizations such as toggling visibility of UI elements.
  • Where: Activity or Fragment where you hold a reference to CometChatCallLogs.
  • Applies to: CometChatCallLogs.
  • Default behavior: All UI elements are visible with default settings.
  • Override: Call the corresponding method on the component instance.
MethodsDescriptionCode
setBackIconVisibilityToggles visibility for the back button in the app bar.setBackIconVisibility(View.VISIBLE);
setToolbarVisibilityToggles visibility for the toolbar in the app bar.setToolbarVisibility(View.GONE);
setLoadingStateVisibilityHides the loading state while fetching call logs.setLoadingStateVisibility(View.GONE);
setErrorStateVisibilityHides the error state on fetching call logs.setErrorStateVisibility(View.GONE);
setEmptyStateVisibilityHides the empty state on fetching call logs.setEmptyStateVisibility(View.GONE);
setSeparatorVisibilityControls visibility of separators in the list view.setSeparatorVisibility(View.GONE);
  • Verify: After calling a visibility method, confirm the corresponding UI element is shown or hidden.

Advanced views

What you’re changing: The default UI elements of call log list items and the component’s chrome (loading, empty, error states, long-press options, date formatting).
  • Where: Activity or Fragment where you hold a reference to CometChatCallLogs.
  • Applies to: CometChatCallLogs.
  • Default behavior: The component renders its built-in views for each part of the call log item and component chrome.
  • Override: Call the corresponding setter method and provide a custom view or callback.

setDateTimeFormatter

Provides a custom implementation of DateTimeFormatterCallback to configure how time and date values are displayed. Each method corresponds to a specific case:
  • time(long timestamp) — Custom full timestamp format
  • today(long timestamp) — Called when a call log is from today
  • yesterday(long timestamp) — Called for yesterday’s call logs
  • lastWeek(long timestamp) — Call logs from the past week
  • otherDays(long timestamp) — Older call logs
  • minute(long timestamp) / hour(long timestamp) — Exact time unit
  • minutes(long diffInMinutesFromNow, long timestamp) — e.g., “5 minutes ago”
  • hours(long diffInHourFromNow, long timestamp) — e.g., “2 hours ago”
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;


cometchatCallLogs.setDateTimeFormatter(new DateTimeFormatterCallback() {

        private final SimpleDateFormat fullTimeFormatter = new SimpleDateFormat("hh:mm a", Locale.getDefault());
        private final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd MMM yyyy", Locale.getDefault());

        @Override
        public String time(long timestamp) {
            return fullTimeFormatter.format(new Date(timestamp));
        }

        @Override
        public String today(long timestamp) {
            return "Today";
        }

        @Override
        public String yesterday(long timestamp) {
            return "Yesterday";
        }

        @Override
        public String lastWeek(long timestamp) {
            return "Last Week";
        }

        @Override
        public String otherDays(long timestamp) {
            return dateFormatter.format(new Date(timestamp));
        }

        @Override
        public String minutes(long diffInMinutesFromNow, long timestamp) {
            return diffInMinutesFromNow + " mins ago";
        }

        @Override
        public String hours(long diffInHourFromNow, long timestamp) {
            return diffInHourFromNow + " hrs ago";
        }
    });
What this does: Overrides the default date/time formatting for call log timestamps. Today’s entries show “Today”, yesterday’s show “Yesterday”, recent entries show “X mins ago” or “X hrs ago”, last week’s show “Last Week”, and older entries show the full date in “dd MMM yyyy” format.

setOptions

Sets a predefined list of actions that users can perform when they long press a call log entry. This replaces the default options entirely.
cometchatConversations.setOptions((context, conversation) -> Collections.emptyList());
What this does: Replaces the default long-press options with an empty list, effectively removing all long-press menu items. This sample appears as shown in the original documentation.

addOptions

Extends the existing set of long-press actions without removing the default ones.
cometchatConversations.addOptions((context, conversation) -> Collections.emptyList());
What this does: Appends an empty list to the existing long-press options, leaving the defaults unchanged. Replace the empty list with your custom MenuItem objects to add new actions.

setLoadingView

Sets a custom loading view displayed when data is being fetched.
cometchatConversations.setLoadingView(R.layout.your_loading_view);
What this does: Replaces the default loading spinner with your custom layout resource. The custom view displays while call logs are being fetched. This sample appears as shown in the original documentation.

setEmptyView

Configures a custom view displayed when there are no call logs in the list.
cometchatConversations.setEmptyView(R.layout.your_empty_view);
What this does: Replaces the default empty state with your custom layout resource. The custom view displays when the call log list has no items. This sample appears as shown in the original documentation.

setErrorView

Defines a custom error state view that appears when an issue occurs while loading call logs.
cometchatConversations.setErrorView(R.layout.your_empty_view);
What this does: Replaces the default error state with your custom layout resource. The custom view displays when the component encounters an error during data fetching. This sample appears as shown in the original documentation.

setItemView

Assigns a completely custom list item design to the Call Logs component, replacing the default layout entirely.
        cometChatCallLog.setItemView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return super.createView(context, listItem);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog call,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {

                super.bindView(context, createdView, call, holder, callList, position);
            }
        });
What this does: Registers a CallLogsViewHolderListener that replaces the entire default call log list item layout. createView inflates your custom layout, and bindView populates it with call log data.
Create a call_log_list_item.xml custom layout file to inflate in setItemView():
call_log_list_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <com.cometchat.chatuikit.shared.views.cometchatavatar.CometChatAvatar
        android:id="@+id/avatar"
        android:layout_width="@dimen/cometchat_48dp"
        android:layout_height="@dimen/cometchat_48dp" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/cometchat_margin_3"
        android:layout_marginEnd="@dimen/cometchat_margin_3"
        android:gravity="center_vertical"
        android:orientation="vertical">

        <TextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:maxLines="1" />

        <TextView
            android:id="@+id/tv_subtitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?attr/cometchatTextAppearanceBodyRegular"
            android:textColor="?attr/cometchatTextColorSecondary" />

    </LinearLayout>

    <Space
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" />

    <TextView
        android:id="@+id/tv_date_call_log"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="afafwaa" />
</LinearLayout>
What this does: Defines a custom list item layout with a CometChatAvatar, title, subtitle, and date text view — providing a compact call log item design with call status information.
Inflate the XML and initialize the views using the call log objects in setItemView:
        cometChatCallLog.setItemView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return LayoutInflater.from(context).inflate(R.layout.call_log_list_item, null);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog call,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {
                CometChatAvatar avatar = view.findViewById(R.id.avatar);
                TextView name = view.findViewById(R.id.tv_title);
                TextView subTitle = view.findViewById(R.id.tv_subtitle);
                TextView date = view.findViewById(R.id.tv_date_call_log);

                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT
                );

                view.setLayoutParams(layoutParams);
                CallUser callUser = (CallUser) call.getInitiator();
                CallUser callUser1 = (CallUser) call.getReceiver();
                boolean isInitiator = callUser.getUid().equals(CometChat.getLoggedInUser().getUid());
                date.setText(new SimpleDateFormat("dd MMM, hh:mm a").format(call.getInitiatedAt() * 1000));
                if (call.getStatus().equals(CometChatCallsConstants.CALL_STATUS_UNANSWERED) || call
                    .getStatus()
                    .equals(CometChatCallsConstants.CALL_STATUS_MISSED)) {
                    avatar.setAvatar(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_missed_call, null));
                    subTitle.setText("Missed Call");
                } else {
                    if (isInitiator) {
                        avatar.setAvatar(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_outgoing_call, null));
                        subTitle.setText("Outgoing Call");
                        name.setText(callUser1.getName());
                    } else {
                        avatar.setAvatar(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_incoming_call, null));
                        subTitle.setText("Incoming Call");
                        name.setText(callUser.getName());
                    }
                }
            }
        });
What this does: Inflates the custom call log list item layout and populates it with call data. The avatar shows a call-type icon (missed, outgoing, or incoming), the subtitle shows the call status text, and the date shows the formatted initiation timestamp. The initiator/receiver logic determines which name and icon to display based on whether the logged-in user initiated the call.

setTitleView

Overrides the default title view in the call log list with a custom layout.
        cometChatCallLog.setTitleView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return super.createView(context, listItem);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog call,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {
                
                super.bindView(context, createdView, call, holder, callList, position);
            }
        });
What this does: Registers a CallLogsViewHolderListener that provides a custom view for the title area of each call log item. createView inflates your layout, and bindView populates it with call log data.
YourActivity.java
        cometChatcallLog.setTitleView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return new TextView(context);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog callLog,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {

                TextView textView = (TextView) createdView;
                textView.setTextAppearance(CometChatTheme.getTextAppearanceHeading4Regular(context));
                textView.setTextColor(CometChatTheme.getTextColorPrimary(context));
                CallUtils.getCallLogUserName(callLog);
                if (callLog.getTotalDurationInMinutes() > 0) {
                    String duration = String.valueOf(callLog.getTotalDurationInMinutes());
                    textView.setText(CallUtils.getCallLogUserName(callLog) + " • \uD83D\uDD5A\uFE0F " + duration
                        .substring(0, duration.length() > 4 ? 4 : 3) + " mins");
                } else textView.setText(CallUtils.getCallLogUserName(callLog));
            }
        });
What this does: Inflates a custom title view that shows the caller name from CallUtils.getCallLogUserName(callLog). If the call duration is greater than 0 minutes, it appends a clock emoji and the duration in minutes. If the duration is 0, it shows only the caller name.

setLeadingView

Customizes the leading view of each call log item — the caller’s avatar or profile picture area.
        cometChatCallLog.setLeadingView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return super.createView(context, listItem);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog call,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {
                
                super.bindView(context, createdView, call, holder, callList, position);
            }
        });
What this does: Registers a CallLogsViewHolderListener that provides a custom view for the leading (left) area of each call log item. createView inflates your layout, and bindView populates it with call log data.
YourActivity.java
cometChatcallLog.setLeadingView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return new CometChatAvatar(context);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog callLog,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {
                CometChatAvatar avatar = (CometChatAvatar) createdView;

                if (callLog.getInitiator() instanceof CallUser) {
                    CallUser initiator = (CallUser) callLog.getInitiator();
                    boolean isLoggedInUser = CallUtils.isLoggedInUser(initiator);
                    boolean isMissedOrUnanswered = callLog.getStatus().equals(CometChatCallsConstants.CALL_STATUS_UNANSWERED) || callLog
                        .getStatus()
                        .equals(CometChatCallsConstants.CALL_STATUS_MISSED);

                    if (callLog.getType().equals(CometChatCallsConstants.CALL_TYPE_AUDIO) || callLog
                        .getType()
                        .equals(CometChatCallsConstants.CALL_TYPE_VIDEO) || callLog.getType().equals(CometChatCallsConstants.CALL_TYPE_AUDIO_VIDEO)) {

                        if (isLoggedInUser) {
                            avatar.setAvatar(ResourcesCompat.getDrawable(context.getResources(), R.drawable.outgoing_voice_call, null));
                        } else if (isMissedOrUnanswered) {
                            avatar.setAvatar(ResourcesCompat.getDrawable(context.getResources(), R.drawable.miss_call, null));

                        } else {
                            avatar.setAvatar(ResourcesCompat.getDrawable(context.getResources(), R.drawable.incoming_voice_call, null));
                        }
                    }
                }
                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
                    Utils.convertDpToPx(context, 50),
                    Utils.convertDpToPx(context, 50)
                );
                avatar.setLayoutParams(layoutParams);
            }
        });
What this does: Implements a custom leading view that shows a call-type icon based on the call status and direction. If the logged-in user initiated the call, it shows an outgoing call icon. If the call was missed or unanswered, it shows a missed call icon. Otherwise, it shows an incoming call icon. The avatar is sized to 50dp × 50dp.

setSubtitleView

Customizes the subtitle view of each call log item. The subtitle displays additional information below the title, such as call type (missed, incoming, outgoing).
        cometChatCallLog.setSubtitleView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return super.createView(context, listItem);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog call,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {
                
                super.bindView(context, createdView, call, holder, callList, position);
            }
        });
What this does: Registers a CallLogsViewHolderListener that provides a custom view for the subtitle area of each call log item. createView inflates your layout, and bindView populates it with call log data.
YourActivity.java
        cometChatCallLog.setSubtitleView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return new TextView(context);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog callLog,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {
                TextView textView = (TextView) createdView;
                CallUser callUser = (CallUser) callLog.getInitiator();
                boolean isInitiator = callUser.getUid().equals(CometChat.getLoggedInUser().getUid());
                if (callLog.getStatus().equals(CometChatCallsConstants.CALL_STATUS_UNANSWERED) || callLog
                    .getStatus()
                    .equals(CometChatCallsConstants.CALL_STATUS_MISSED)) {
                    textView.setText("Missed Call");
                } else {
                    if (isInitiator) {
                        textView.setText("Outgoing Call");
                    } else {
                        textView.setText("Incoming Call");
                    }
                }
            }
        });
What this does: Replaces the default subtitle with a custom TextView that shows the call direction. If the call was missed or unanswered, it displays “Missed Call”. If the logged-in user initiated the call, it displays “Outgoing Call”. Otherwise, it displays “Incoming Call”.

setTrailingView

Customizes the trailing (end) view of a call log item, used for call duration, timestamps, or action buttons.
        cometChatCallLog.setTrailingView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return super.createView(context, listItem);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog call,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {

                super.bindView(context, createdView, call, holder, callList, position);
            }
        });
What this does: Registers a CallLogsViewHolderListener that provides a custom view for the trailing (right) area of each call log item. createView inflates your layout, and bindView populates it with call log data.
YourActivity.java
        cometChatcallLog.setTrailingView(new CallLogsViewHolderListener() {
            @Override
            public View createView(Context context, CometchatCallLogsItemsBinding listItem) {
                return new TextView(context);
            }

            @Override
            public void bindView(Context context,
                                 View createdView,
                                 CallLog callLog,
                                 RecyclerView.ViewHolder holder,
                                 List<CallLog> callList,
                                 int position) {
                TextView textView = (TextView) createdView;
                textView.setText(new SimpleDateFormat("dd MMM, hh:mm a").format(callLog.getInitiatedAt() * 1000));
            }
        });
What this does: Replaces the default trailing view with a custom TextView that shows the call initiation timestamp formatted as “dd MMM, hh:mm a” (e.g., “10 Jul, 02:30 PM”).
  • Verify: After setting any advanced view, confirm the custom view renders in the correct position within the call log list item, and the data binding populates correctly for each call log entry.

Customization matrix

What you want to changeWhereProperty/APIExample
Avatar style (corner radius, background)themes.xmlCometChatCallLogsStyle with cometchatCallLogsAvatarStyle<item name="cometchatAvatarStrokeRadius">8dp</item>
Separator colorthemes.xmlCometChatCallLogsStyle with cometchatCallLogsSeparatorColor<item name="cometchatCallLogsSeparatorColor">#F76808</item>
Title text colorthemes.xmlCometChatCallLogsStyle with cometchatCallLogsTitleTextColor<item name="cometchatCallLogsTitleTextColor">#F76808</item>
Apply a custom styleActivity/FragmentsetStyle(int styleRes)cometchatCallLogs.setStyle(R.style.CustomCallLogStyle);
Back button visibilityActivity/FragmentsetBackIconVisibility(int).setBackIconVisibility(View.VISIBLE);
Toolbar visibilityActivity/FragmentsetToolbarVisibility(int).setToolbarVisibility(View.GONE);
Loading state visibilityActivity/FragmentsetLoadingStateVisibility(int).setLoadingStateVisibility(View.GONE);
Error state visibilityActivity/FragmentsetErrorStateVisibility(int).setErrorStateVisibility(View.GONE);
Empty state visibilityActivity/FragmentsetEmptyStateVisibility(int).setEmptyStateVisibility(View.GONE);
Separator visibilityActivity/FragmentsetSeparatorVisibility(int).setSeparatorVisibility(View.GONE);
Date/time formattingActivity/FragmentsetDateTimeFormatter(DateTimeFormatterCallback)See setDateTimeFormatter code above
Long-press options (replace)Activity/FragmentsetOptions(Function2)See setOptions code above
Long-press options (append)Activity/FragmentaddOptions(Function2)See addOptions code above
Loading viewActivity/FragmentsetLoadingView(int)cometchatConversations.setLoadingView(R.layout.your_loading_view);
Empty viewActivity/FragmentsetEmptyView(int)cometchatConversations.setEmptyView(R.layout.your_empty_view);
Error viewActivity/FragmentsetErrorView(int)cometchatConversations.setErrorView(R.layout.your_empty_view);
Leading view (avatar area)Activity/FragmentsetLeadingView(CallLogsViewHolderListener)See setLeadingView code above
Title viewActivity/FragmentsetTitleView(CallLogsViewHolderListener)See setTitleView code above
Subtitle viewActivity/FragmentsetSubtitleView(CallLogsViewHolderListener)See setSubtitleView code above
Trailing viewActivity/FragmentsetTrailingView(CallLogsViewHolderListener)See setTrailingView code above
Entire list itemActivity/FragmentsetItemView(CallLogsViewHolderListener)See setItemView code above
Filter call logsActivity/FragmentsetCallLogRequestBuilder(CallLogRequestBuilder)See Filters code above

Common pitfalls & fixes

PitfallFix
Component does not renderEnsure CometChatUIKit.init() is called and awaited before using any UI Kit component. If init() has not completed, the component will not load data.
Call log list is empty despite having call historyVerify that a user is logged in with CometChatUIKit.login() before displaying the component. The component fetches call logs for the logged-in user only.
Filters not appliedEnsure you call setCallLogRequestBuilder(callLogRequestBuilder) on the CometChatCallLogs instance after creating and configuring the builder.
Custom style not visibleVerify the style parent is CometChatCallLogsStyle and that you call setStyle(R.style.YourStyle) on the component instance.
setOnItemClick not firingIf the component is inside a parent view that intercepts touch events, ensure the parent does not consume the click. Verify the callback is set before the component loads data.
Custom view returns null in createViewIf createView returns null, the default view is used. Return a valid inflated View to replace the default.
Call status icons not showing in custom leading viewEnsure you check callLog.getStatus() against CometChatCallsConstants.CALL_STATUS_UNANSWERED and CometChatCallsConstants.CALL_STATUS_MISSED to determine the correct icon.
View binding reference is nullIf using view binding, initialize it with binding = YourXmlFileNameBinding.inflate(getLayoutInflater()) before accessing binding.callLog.

FAQ

Q: How do I filter call logs to show only calls with recordings? A: Create a CallLogRequest.CallLogRequestBuilder, call setHasRecording(true), and pass it to setCallLogRequestBuilder. Q: Can I use CometChatCallLogs in both an Activity and a Fragment? A: Yes. In an Activity, create new CometChatCallLogs(this) and call setContentView. In a Fragment, create new CometChatCallLogs(requireContext()) and return it from onCreateView. Q: Does CometChatCallLogs emit any events? A: No. The CometChatCallLogs component does not have any exposed events. Q: How do I customize the call log item to show call direction icons? A: Use setLeadingView with a CallLogsViewHolderListener. In bindView, check CallUtils.isLoggedInUser(initiator) and callLog.getStatus() to determine whether to show an outgoing, incoming, or missed call icon. Q: How do I show call duration in the title? A: Use setTitleView with a CallLogsViewHolderListener. In bindView, check callLog.getTotalDurationInMinutes() and append the duration to the caller name from CallUtils.getCallLogUserName(callLog).

Next steps