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-androiddependency added to your project. - A valid
layout_activity.xmlor Activity/Fragment where you will place the component.
Quick start
- Open your
layout_activity.xmlfile. - Add the
CometChatCallLogsXML element:
layout_activity.xml
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.
- Build and run your app.
- Verify that the call log list appears with caller names, avatars, call status indicators, and timestamps.

- 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, andsetOnBackPressListenerthat let you respond to user interactions. - Filters: Use
CallLogRequest.CallLogRequestBuilderto filter call logs by limit, call type, call status, recording status, call direction, UID, GUID, call category, or auth token. - Events: The
CometChatCallLogscomponent does not have any exposed events. - Style: XML theme styles (parent
CometChatCallLogsStyle) applied viasetStyle()to customize colors, fonts, and sub-component styles. - Advanced views: Methods like
setLeadingView,setTitleView,setTrailingView,setItemView, andsetSubtitleViewthat let you replace default UI elements with custom layouts.
Implementation
Activity integration
What you’re changing: How you addCometChatCallLogs to an Activity programmatically.
- Where: Your Activity class (e.g.,
YourActivity.javaorYourActivity.kt). - Applies to:
CometChatCallLogs. - Default behavior: The component is not added until you set it as the content view.
- Override: Create a
CometChatCallLogsinstance and callsetContentViewinonCreate. - Code:
- Java
- Kotlin
YourActivity.java
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 addCometChatCallLogs to a Fragment.
- Where: Your Fragment class (e.g.,
YourFragment.javaorYourFragment.kt). - Applies to:
CometChatCallLogs. - Default behavior: The component is not added until you return it from
onCreateView. - Override: Create a
CometChatCallLogsinstance and return it fromonCreateView. - Code:
- Java
- Kotlin
YourFragment.java
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.
- Java
- Kotlin
YourActivity.java
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.
- Java
- Kotlin
YourActivity.java
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.
- Java
- Kotlin
YourActivity.java
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.
- Java
- Kotlin
YourActivity.java
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.
- Java
- Kotlin
YourActivity.java
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.
- Java
- Kotlin
YourActivity.java
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 tosetCallLogRequestBuilder.
| Property | Description | Code |
|---|---|---|
| Limit | Sets the limit for the call logs request | .setLimit(int limit) |
| Call Type | Sets the call type for the call logs request | .setCallType(String callType) |
| Call Status | Sets the call status for the call logs request | .setCallStatus(String callStatus) |
| Has Recording | Sets the recording status for the call logs request | .setHasRecording(boolean hasRecording) |
| Call Direction | Sets the call direction for the call logs request | .setCallDirection(String callDirection) |
| UID | Sets the user ID for the call logs request | .setUid(String uid) |
| GUID | Sets the group ID for the call logs request | .setGuid(String guid) |
| Call Category | Sets the call category for the call logs request | .setCallCategory(String callCategory) |
| Auth Token | Sets the auth token for the call logs request | .setAuthToken(String authToken) |
- Code:
- Java
- Kotlin
What this does: Creates aCallLogRequestBuilderthat filters call logs to show only entries with recordings, with a limit of 20 per fetch. The builder is then applied to theCometChatCallLogscomponent.
- Verify: The call log list shows only call logs that have recordings and fetches at most 20 items per request.
Events
TheCometChatCallLogs 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.xmlfor 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
CometChatCallLogsStyleinthemes.xml, then callsetStyle()on the component.

- Code:
themes.xml
What this does: Defines two custom styles:CustomAvatarStylesets the avatar corner radius to 8dp and background color to#FBAA75;CustomCallLogStylesets the separator color and title text color to#F76808and applies the custom avatar style.
- Java
- Kotlin
What this does: Applies theTo know more such attributes, visit the attributes file.CustomCallLogStyletheme to theCometChatCallLogscomponent, changing the separator color, title text color, and avatar appearance.
- 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.
| Methods | Description | Code |
|---|---|---|
setBackIconVisibility | Toggles visibility for the back button in the app bar | .setBackIconVisibility(View.VISIBLE); |
setToolbarVisibility | Toggles visibility for the toolbar in the app bar | .setToolbarVisibility(View.GONE); |
setLoadingStateVisibility | Hides the loading state while fetching call logs | .setLoadingStateVisibility(View.GONE); |
setErrorStateVisibility | Hides the error state on fetching call logs | .setErrorStateVisibility(View.GONE); |
setEmptyStateVisibility | Hides the empty state on fetching call logs | .setEmptyStateVisibility(View.GONE); |
setSeparatorVisibility | Controls 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 formattoday(long timestamp)— Called when a call log is from todayyesterday(long timestamp)— Called for yesterday’s call logslastWeek(long timestamp)— Call logs from the past weekotherDays(long timestamp)— Older call logsminute(long timestamp)/hour(long timestamp)— Exact time unitminutes(long diffInMinutesFromNow, long timestamp)— e.g., “5 minutes ago”hours(long diffInHourFromNow, long timestamp)— e.g., “2 hours ago”
- Java
- Kotlin
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.
- Java
- Kotlin
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.
- Java
- Kotlin
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.
- Java
- Kotlin
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.
- Java
- Kotlin
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.
- Java
- Kotlin
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.
- Java
- Kotlin
What this does: Registers aCallLogsViewHolderListenerthat replaces the entire default call log list item layout.createViewinflates your custom layout, andbindViewpopulates it with call log data.

call_log_list_item.xml custom layout file to inflate in setItemView():
call_log_list_item.xml
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:
- Java
- Kotlin
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.
- Java
- Kotlin
What this does: Registers aCallLogsViewHolderListenerthat provides a custom view for the title area of each call log item.createViewinflates your layout, andbindViewpopulates it with call log data.

- Java
- Kotlin
YourActivity.java
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.
- Java
- Kotlin
What this does: Registers aCallLogsViewHolderListenerthat provides a custom view for the leading (left) area of each call log item.createViewinflates your layout, andbindViewpopulates it with call log data.

- Java
- Kotlin
YourActivity.java
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).
- Java
- Kotlin
What this does: Registers aCallLogsViewHolderListenerthat provides a custom view for the subtitle area of each call log item.createViewinflates your layout, andbindViewpopulates it with call log data.

- Java
- Kotlin
YourActivity.java
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.
- Java
- Kotlin
What this does: Registers aCallLogsViewHolderListenerthat provides a custom view for the trailing (right) area of each call log item.createViewinflates your layout, andbindViewpopulates it with call log data.

- Java
- Kotlin
YourActivity.java
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 change | Where | Property/API | Example |
|---|---|---|---|
| Avatar style (corner radius, background) | themes.xml | CometChatCallLogsStyle with cometchatCallLogsAvatarStyle | <item name="cometchatAvatarStrokeRadius">8dp</item> |
| Separator color | themes.xml | CometChatCallLogsStyle with cometchatCallLogsSeparatorColor | <item name="cometchatCallLogsSeparatorColor">#F76808</item> |
| Title text color | themes.xml | CometChatCallLogsStyle with cometchatCallLogsTitleTextColor | <item name="cometchatCallLogsTitleTextColor">#F76808</item> |
| Apply a custom style | Activity/Fragment | setStyle(int styleRes) | cometchatCallLogs.setStyle(R.style.CustomCallLogStyle); |
| Back button visibility | Activity/Fragment | setBackIconVisibility(int) | .setBackIconVisibility(View.VISIBLE); |
| Toolbar visibility | Activity/Fragment | setToolbarVisibility(int) | .setToolbarVisibility(View.GONE); |
| Loading state visibility | Activity/Fragment | setLoadingStateVisibility(int) | .setLoadingStateVisibility(View.GONE); |
| Error state visibility | Activity/Fragment | setErrorStateVisibility(int) | .setErrorStateVisibility(View.GONE); |
| Empty state visibility | Activity/Fragment | setEmptyStateVisibility(int) | .setEmptyStateVisibility(View.GONE); |
| Separator visibility | Activity/Fragment | setSeparatorVisibility(int) | .setSeparatorVisibility(View.GONE); |
| Date/time formatting | Activity/Fragment | setDateTimeFormatter(DateTimeFormatterCallback) | See setDateTimeFormatter code above |
| Long-press options (replace) | Activity/Fragment | setOptions(Function2) | See setOptions code above |
| Long-press options (append) | Activity/Fragment | addOptions(Function2) | See addOptions code above |
| Loading view | Activity/Fragment | setLoadingView(int) | cometchatConversations.setLoadingView(R.layout.your_loading_view); |
| Empty view | Activity/Fragment | setEmptyView(int) | cometchatConversations.setEmptyView(R.layout.your_empty_view); |
| Error view | Activity/Fragment | setErrorView(int) | cometchatConversations.setErrorView(R.layout.your_empty_view); |
| Leading view (avatar area) | Activity/Fragment | setLeadingView(CallLogsViewHolderListener) | See setLeadingView code above |
| Title view | Activity/Fragment | setTitleView(CallLogsViewHolderListener) | See setTitleView code above |
| Subtitle view | Activity/Fragment | setSubtitleView(CallLogsViewHolderListener) | See setSubtitleView code above |
| Trailing view | Activity/Fragment | setTrailingView(CallLogsViewHolderListener) | See setTrailingView code above |
| Entire list item | Activity/Fragment | setItemView(CallLogsViewHolderListener) | See setItemView code above |
| Filter call logs | Activity/Fragment | setCallLogRequestBuilder(CallLogRequestBuilder) | See Filters code above |
Common pitfalls & fixes
| Pitfall | Fix |
|---|---|
| Component does not render | Ensure 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 history | Verify 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 applied | Ensure you call setCallLogRequestBuilder(callLogRequestBuilder) on the CometChatCallLogs instance after creating and configuring the builder. |
| Custom style not visible | Verify the style parent is CometChatCallLogsStyle and that you call setStyle(R.style.YourStyle) on the component instance. |
setOnItemClick not firing | If 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 createView | If 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 view | Ensure you check callLog.getStatus() against CometChatCallsConstants.CALL_STATUS_UNANSWERED and CometChatCallsConstants.CALL_STATUS_MISSED to determine the correct icon. |
| View binding reference is null | If 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 aCallLogRequest.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).