> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Call Logs

> Scrollable list of call logs for the logged-in user with caller names, avatars, call status, and timestamps.

`CometChatCallLogs` renders a scrollable list of call logs for the logged-in user with caller names, avatars, call status indicators, and timestamps.

![](https://mintcdn.com/cometchat-22654f5b/NuY3hD_g_g_X-fwH/images/7fe2a6db-call_logs-7b4f502153923374898f3887441ab8d2.png?fit=max\&auto=format\&n=NuY3hD_g_g_X-fwH\&q=85\&s=21a0b6b47ccd2d7a79d5b714b0eb15d2)

***

> [!WARNING]
>
> **Requires the Calls SDK AND calling to be initialized — this component CRASHES otherwise.**
> `CometChatCallLogs` builds a `CallLogRequest` in its ViewModel's `init {}`, with **no availability
> check**, so simply placing it on a screen is fatal unless both conditions hold. Verified on device:
>
> | Calls artifact | `uiKit.enableCalling` | Result |
> | - | - | - |
> | absent | anything | `java.lang.NoClassDefFoundError: …CallLogRequest$CallLogRequestBuilder` |
> | present | `false` | `java.lang.RuntimeException: Please call the CometChatCalls.init() method …` |
> | present | `true` | renders (empty/error state when there are no logs) |
>
> Both are required:
>
> ```kotlin theme={null}
> // app/build.gradle.kts
> implementation("com.cometchat:calls-sdk-android:5.0.+")
> ```
>
> ```json theme={null}
> // app/src/main/assets/cometchat-settings.json — this is what makes the UI Kit init CometChatCalls
> { "uiKit": { "enableCalling": true } }
> ```
>
> The component **compiles fine** in every case — the failure is runtime-only, so a build cannot warn
> you. The same applies to the other calling components.

## Where It Fits

`CometChatCallLogs` is a list component. It renders the user's call history and emits the selected `CallLog` via `onItemClick`. Use it as a standalone call history screen or as a tab in a tabbed layout alongside conversations and contacts.

> [tab] Kotlin (XML Views)
>
> ```xml activity_call_logs.xml lines theme={null}
> <com.cometchat.uikit.kotlin.presentation.calllogs.ui.CometChatCallLogs
>     android:id="@+id/call_logs"
>     android:layout_width="match_parent"
>     android:layout_height="match_parent" />
> ```
>
> ```kotlin lines theme={null}
> val callLogs = findViewById<CometChatCallLogs>(R.id.call_logs)
>
> callLogs.setOnItemClick { callLog ->
>     // Navigate to call detail or initiate call
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     modifier = Modifier.fillMaxSize(),
>     onItemClick = { callLog ->
>         // Navigate to call detail or initiate call
>     }
> )
> ```

***

## Quick Start

> [tab] Kotlin (XML Views)
>
> Add to your layout XML:
>
> ```xml lines theme={null}
> <com.cometchat.uikit.kotlin.presentation.calllogs.ui.CometChatCallLogs
>     android:id="@+id/call_logs"
>     android:layout_width="match_parent"
>     android:layout_height="match_parent" />
> ```
>
> Or programmatically:
>
> ```kotlin lines theme={null}
> override fun onCreate(savedInstanceState: Bundle?) {
>     super.onCreate(savedInstanceState)
>     setContentView(CometChatCallLogs(this))
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> @Composable
> fun CallLogsScreen() {
>     CometChatCallLogs(
>         modifier = Modifier.fillMaxSize()
>     )
> }
> ```

Prerequisites: CometChat SDK initialized with `CometChatUIKit.init()`, a user logged in, the UI Kit dependency added, and the CometChat Calls SDK configured.

Or in a Fragment:

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
>     return CometChatCallLogs(requireContext())
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
>     return ComposeView(requireContext()).apply {
>         setContent { CometChatCallLogs() }
>     }
> }
> ```

***

## Filtering Call Logs

> [tab] Kotlin (XML Views)
>
> Pass a `CallLogRequest.CallLogRequestBuilder` to control what loads:
>
> ```kotlin lines theme={null}
> callLogs.setCallLogRequestBuilder(
>     CallLogRequest.CallLogRequestBuilder()
>         .setLimit(20)
>         .setCallCategory(CometChatConstants.CALL_CATEGORY_CALL)
> )
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     callLogRequestBuilder = CallLogRequest.CallLogRequestBuilder()
>         .setLimit(20)
>         .setCallCategory(CometChatConstants.CALL_CATEGORY_CALL)
> )
> ```

### Filter Recipes

| Recipe | Builder method |
| - | - |
| Limit per page | `.setLimit(10)` |
| Audio calls only | `.setCallType(CometChatConstants.CALL_TYPE_AUDIO)` |
| Video calls only | `.setCallType(CometChatConstants.CALL_TYPE_VIDEO)` |
| Call category | `.setCallCategory(CometChatConstants.CALL_CATEGORY_CALL)` |

> [!WARNING]
>
> Pass the builder object, not the result of `.build()`. The component calls `.build()` internally. Default page size is 30 with infinite scroll.

***

## Actions and Events

### Callback Methods

#### `onItemClick`

Fires when a call log row is tapped. Primary navigation hook.

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setOnItemClick { callLog ->
>     // Navigate to call detail
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     onItemClick = { callLog ->
>         // Navigate to call detail
>     }
> )
> ```

> Replaces the default item-click behavior. Your custom lambda executes instead of the built-in navigation.

#### `onItemLongClick`

Fires when a call log row is long-pressed.

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setOnItemLongClick { callLog ->
>     // Show context menu
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     onItemLongClick = { callLog ->
>         // Show context menu
>     }
> )
> ```

#### `onBackPress`

Fires when the user presses the back button in the toolbar.

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setOnBackPress {
>     finish()
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     onBackPress = { /* navigate back */ }
> )
> ```

#### `onError`

Fires on internal errors (network failure, auth issue, SDK exception).

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setOnError { exception ->
>     Log.e("CallLogs", "Error: ${exception.message}")
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     onError = { exception ->
>         Log.e("CallLogs", "Error: ${exception.message}")
>     }
> )
> ```

#### `onLoad`

Fires when the list is successfully fetched and loaded.

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setOnLoad { callLogList ->
>     Log.d("CallLogs", "Loaded ${callLogList.size}")
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     onLoad = { callLogList ->
>         Log.d("CallLogs", "Loaded ${callLogList.size}")
>     }
> )
> ```

#### `onEmpty`

Fires when the list is empty after loading.

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setOnEmpty {
>     Log.d("CallLogs", "No call logs")
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     onEmpty = { /* no call logs */ }
> )
> ```

***

## Functionality

| Method (Kotlin XML) | Compose Parameter | Description |
| - | - | - |
| `setBackIconVisibility(View.VISIBLE)` | `hideBackIcon = false` | Toggle back button |
| `setToolbarVisibility(View.GONE)` | `hideToolbar = true` | Toggle toolbar |
| `setSeparatorVisibility(View.GONE)` | `hideSeparator = true` | Toggle list separators |
| `setTitle("Call History")` | `title = "Call History"` | Custom toolbar title |

***

## Custom View Slots

### Leading View

Replace the avatar / left section.

![](https://mintcdn.com/cometchat-22654f5b/CrArf1QwUPg5EvCC/images/2d1b8f1f-calls_leading_view-f16178cad5831b68b69386bddd17ac97.png?fit=max\&auto=format\&n=CrArf1QwUPg5EvCC\&q=85\&s=3b7462d378b859d2d6a4ec08d96f5ede)

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setLeadingView(object : CallLogsViewHolderListener() {
>     override fun createView(context: Context, binding: CometchatListBaseItemsBinding): View {
>         return ImageView(context).apply {
>             layoutParams = ViewGroup.LayoutParams(48.dp, 48.dp)
>         }
>     }
>
>     override fun bindView(
>         context: Context, createdView: View, callLog: CallLog,
>         holder: RecyclerView.ViewHolder, callLogList: List<CallLog>, position: Int
>     ) {
>         val imageView = createdView as ImageView
>         // Load caller avatar
>     }
> })
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     leadingView = { callLog ->
>         CometChatAvatar(
>             imageUrl = callLog.initiator?.avatar,
>             name = callLog.initiator?.name
>         )
>     }
> )
> ```

### Title View

Replace the name / title text.

![](https://mintcdn.com/cometchat-22654f5b/czi9y0KbDwCW-4OY/images/70338d8e-calls_title_view-284a29cf898ed446cd6b56b480dba55e.png?fit=max\&auto=format\&n=czi9y0KbDwCW-4OY\&q=85\&s=869bc8b184b11dba5975d40b8b8d33d4)

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setTitleView(object : CallLogsViewHolderListener() {
>     override fun createView(context: Context, binding: CometchatListBaseItemsBinding): View {
>         return TextView(context)
>     }
>
>     override fun bindView(
>         context: Context, createdView: View, callLog: CallLog,
>         holder: RecyclerView.ViewHolder, callLogList: List<CallLog>, position: Int
>     ) {
>         (createdView as TextView).text = callLog.initiator?.name ?: ""
>     }
> })
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     titleView = { callLog ->
>         Text(
>             text = callLog.initiator?.name ?: "",
>             style = CometChatTheme.typography.heading4Medium
>         )
>     }
> )
> ```

### Subtitle View

Replace the subtitle text below the caller's name.

![](https://mintcdn.com/cometchat-22654f5b/tI1D0nyKUVcz2LEZ/images/c0c5e53a-calls_subtitle_view-23dbb0f58400e2d8e4b4b1112eb75757.png?fit=max\&auto=format\&n=tI1D0nyKUVcz2LEZ\&q=85\&s=15dea5af127fbbeff34ee77ae6d129e9)

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setSubtitleView(object : CallLogsViewHolderListener() {
>     override fun createView(context: Context, binding: CometchatListBaseItemsBinding): View {
>         return TextView(context).apply { maxLines = 1; ellipsize = TextUtils.TruncateAt.END }
>     }
>
>     override fun bindView(
>         context: Context, createdView: View, callLog: CallLog,
>         holder: RecyclerView.ViewHolder, callLogList: List<CallLog>, position: Int
>     ) {
>         (createdView as TextView).text = callLog.status ?: "Unknown"
>     }
> })
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     subtitleView = { callLog ->
>         Text(
>             text = callLog.status ?: "Unknown",
>             maxLines = 1,
>             overflow = TextOverflow.Ellipsis
>         )
>     }
> )
> ```

### Trailing View

Replace the right section of each call log item.

![](https://mintcdn.com/cometchat-22654f5b/0Cdnhz6eU6kdn5Ms/images/b471a86b-calls_tail_view-c2c6951de1fd0e56ac3a8b3038fea648.png?fit=max\&auto=format\&n=0Cdnhz6eU6kdn5Ms\&q=85\&s=0756ee987dea810616751176639f7547)

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setTrailingView(object : CallLogsViewHolderListener() {
>     override fun createView(context: Context, binding: CometchatListBaseItemsBinding): View {
>         return TextView(context)
>     }
>
>     override fun bindView(
>         context: Context, createdView: View, callLog: CallLog,
>         holder: RecyclerView.ViewHolder, callLogList: List<CallLog>, position: Int
>     ) {
>         (createdView as TextView).text = SimpleDateFormat("h:mm a", Locale.getDefault())
>             .format(Date(callLog.initiatedAt * 1000))
>     }
> })
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     trailingView = { callLog ->
>         Text(
>             text = SimpleDateFormat("h:mm a", Locale.getDefault())
>                 .format(Date(callLog.initiatedAt * 1000))
>         )
>     }
> )
> ```

### Item View

Replace the entire list item row.

![](https://mintcdn.com/cometchat-22654f5b/avBd8wan4jblx26s/images/26e76652-calls_list_item_view-6ab3eea9c5769eac919d78b5a358ae7a.png?fit=max\&auto=format\&n=avBd8wan4jblx26s\&q=85\&s=b5d090843457d0da5b6f32d2b8a24656)

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setItemView(object : CallLogsViewHolderListener() {
>     override fun createView(context: Context, binding: CometchatListBaseItemsBinding): View {
>         return LayoutInflater.from(context).inflate(R.layout.custom_call_log_item, null)
>     }
>
>     override fun bindView(
>         context: Context, createdView: View, callLog: CallLog,
>         holder: RecyclerView.ViewHolder, callLogList: List<CallLog>, position: Int
>     ) {
>         val avatar = createdView.findViewById<CometChatAvatar>(R.id.custom_avatar)
>         val title = createdView.findViewById<TextView>(R.id.tvName)
>         title.text = callLog.initiator?.name
>         avatar.setAvatar(callLog.initiator?.name, callLog.initiator?.avatar)
>     }
> })
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     itemView = { callLog ->
>         Row(
>             modifier = Modifier.fillMaxWidth().padding(12.dp),
>             verticalAlignment = Alignment.CenterVertically
>         ) {
>             CometChatAvatar(imageUrl = callLog.initiator?.avatar, name = callLog.initiator?.name)
>             Spacer(Modifier.width(12.dp))
>             Column(modifier = Modifier.weight(1f)) {
>                 Text(callLog.initiator?.name ?: "", style = CometChatTheme.typography.heading4Medium)
>                 Text(callLog.status ?: "", style = CometChatTheme.typography.body3Regular)
>             }
>         }
>     }
> )
> ```

### State Views

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setEmptyView(R.layout.custom_empty_view)
> callLogs.setErrorView(R.layout.custom_error_view)
> callLogs.setLoadingView(R.layout.custom_loading_view)
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     emptyView = { Text("No call logs") },
>     errorView = { onRetry -> Button(onClick = onRetry) { Text("Retry") } },
>     loadingView = { CircularProgressIndicator() }
> )
> ```

### Overflow Menu

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setOverflowMenu(ImageButton(context).apply {
>     setImageResource(R.drawable.ic_filter)
>     setOnClickListener { /* show filter */ }
> })
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     overflowMenu = {
>         IconButton(onClick = { /* show filter */ }) {
>             Icon(painterResource(R.drawable.ic_filter), "Filter")
>         }
>     }
> )
> ```

***

## Menu Options

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> // Replace all options
> callLogs.setOptions { context, callLog ->
>     listOf(
>         CometChatPopupMenu.MenuItem(id = "delete", name = "Delete", onClick = { /* ... */ }),
>         CometChatPopupMenu.MenuItem(id = "callback", name = "Call Back", onClick = { /* ... */ })
>     )
> }
>
> // Append to defaults
> callLogs.setAddOptions { context, callLog ->
>     listOf(
>         CometChatPopupMenu.MenuItem(id = "info", name = "Info", onClick = { /* ... */ })
>     )
> }
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     options = { context, callLog ->
>         listOf(
>             MenuItem(id = "delete", name = "Delete", onClick = { /* ... */ }),
>             MenuItem(id = "callback", name = "Call Back", onClick = { /* ... */ })
>         )
>     },
>     addOptions = { context, callLog ->
>         listOf(MenuItem(id = "info", name = "Info", onClick = { /* ... */ }))
>     }
> )
> ```

***

## Common Patterns

### Minimal list — hide all chrome

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setToolbarVisibility(View.GONE)
> callLogs.setSeparatorVisibility(View.GONE)
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     hideToolbar = true,
>     hideSeparator = true
> )
> ```

### Audio calls only

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setCallLogRequestBuilder(
>     CallLogRequest.CallLogRequestBuilder()
>         .setCallType(CometChatConstants.CALL_TYPE_AUDIO)
> )
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     callLogRequestBuilder = CallLogRequest.CallLogRequestBuilder()
>         .setCallType(CometChatConstants.CALL_TYPE_AUDIO)
> )
> ```

### Video calls only

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setCallLogRequestBuilder(
>     CallLogRequest.CallLogRequestBuilder()
>         .setCallType(CometChatConstants.CALL_TYPE_VIDEO)
> )
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     callLogRequestBuilder = CallLogRequest.CallLogRequestBuilder()
>         .setCallType(CometChatConstants.CALL_TYPE_VIDEO)
> )
> ```

***

## Advanced Methods

### ViewModel Access

```kotlin lines theme={null}
val factory = CometChatCallLogsViewModelFactory()
val viewModel = ViewModelProvider(this, factory)
    .get(CometChatCallLogsViewModel::class.java)
```

> [tab] Kotlin (XML Views)
>
> ```kotlin lines theme={null}
> callLogs.setViewModel(viewModel)
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     callLogsViewModel = viewModel
> )
> ```

See [ViewModel & Data](https://www.cometchat.com/docs/ui-kit/android/customization-viewmodel-data.md) for ListOperations, state observation, and custom repositories.

***

## Style

![](https://mintcdn.com/cometchat-22654f5b/T-kVUXtubs0NtFU5/images/d0eb378f-calls_styling-72e5f287e16313403492a56094660446.png?fit=max\&auto=format\&n=T-kVUXtubs0NtFU5\&q=85\&s=f1bd6d21c52392c5d0217e65ddeacf53)

> [tab] Kotlin (XML Views)
>
> Define a custom style in `themes.xml`:
>
> ```xml themes.xml lines theme={null}
> <style name="CustomCallLogsAvatarStyle" parent="CometChatAvatarStyle">
>     <item name="cometchatAvatarStrokeRadius">8dp</item>
>     <item name="cometchatAvatarBackgroundColor">#FBAA75</item>
> </style>
>
> <style name="CustomCallLogsStyle" parent="CometChatCallLogsStyle">
>     <item name="cometchatCallLogsAvatarStyle">@style/CustomCallLogsAvatarStyle</item>
>     <item name="cometchatCallLogsSeparatorColor">#F76808</item>
>     <item name="cometchatCallLogsTitleTextColor">#F76808</item>
> </style>
>
> <style name="AppTheme" parent="CometChatTheme.DayNight">
>     <item name="cometchatCallLogsStyle">@style/CustomCallLogsStyle</item>
> </style>
> ```

> [tab] Jetpack Compose
>
> ```kotlin lines theme={null}
> CometChatCallLogs(
>     style = CometChatCallLogsStyle.default().copy(
>         backgroundColor = Color(0xFFF5F5F5),
>         titleTextColor = Color(0xFF141414),
>         itemStyle = CometChatCallLogsListItemStyle.default().copy(
>             backgroundColor = Color.White,
>             titleTextColor = Color(0xFF141414),
>             subtitleTextColor = Color(0xFF727272),
>             avatarStyle = CometChatAvatarStyle.default().copy(cornerRadius = 12.dp)
>         )
>     )
> )
> ```

### Style Properties

| Property | Description |
| - | - |
| `backgroundColor` | List background color |
| `titleTextColor` | Toolbar title color |
| `itemStyle.backgroundColor` | Row background |
| `itemStyle.titleTextColor` | Caller name color |
| `itemStyle.subtitleTextColor` | Call status text color |
| `itemStyle.separatorColor` | Row separator color |
| `itemStyle.avatarStyle` | Avatar appearance |

See [Component Styling](https://www.cometchat.com/docs/ui-kit/android/component-styling.md) for the full reference.

***

## Next Steps

> [card] [Call Features](https://www.cometchat.com/docs/ui-kit/android/call-features.md)
>
> Voice and video calling overview

> [card] [Conversations](https://www.cometchat.com/docs/ui-kit/android/conversations.md)
>
> Browse recent conversations

> [card] [Component Styling](https://www.cometchat.com/docs/ui-kit/android/component-styling.md)
>
> Detailed styling reference with screenshots

> [card] [ViewModel & Data](https://www.cometchat.com/docs/ui-kit/android/customization-viewmodel-data.md)
>
> Custom ViewModels, repositories, and ListOperations


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.