Skip to main content
This guide builds a sequential navigation chat layout — conversation list as the entry point, tap a conversation to open a full-screen message view. Users see their conversation list and tap any conversation to open the chat. This assumes you’ve already completed Integration (project created, dependencies installed, init + login working, theme set up).

What You’re Building

Three sections working together:
  1. Conversation list — shows all active conversations (users and groups)
  2. Message header — displays user/group name, avatar, and status
  3. Message list + composer — chat history with real-time updates and text input
This implementation uses Android’s standard Activity navigation: ConversationActivity displays the list, user taps a conversation, MessageActivity launches with the selected user/group data via Intent extras.

Step 1: Set Up Conversation Activity

Create a new Activity called ConversationActivity to display the list of conversations.

Layout

Define the layout using the CometChatConversations component in activity_conversations.xml:
activity_conversations.xml

Activity

Initialize the CometChatConversations component and handle conversation item clicks to navigate to the message screen:
ConversationActivity.kt
You must use an activity that supports the lifecycle API, such as:
  • AppCompatActivity
  • ComponentActivity
  • FragmentActivity
This is necessary to properly manage the UI Kit’s lifecycle events.

Step 2: Set Up Message Activity

Create a new Activity - MessageActivity to display the chat interface.

Layout

Define the layout with CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer in activity_message.xml:
activity_message.xml

Activity

Retrieve the user/group ID from the Intent extras and configure the message components:
MessageActivity.kt

Step 3: Update MainActivity

Update your MainActivity to launch ConversationActivity after successful login:
MainActivity.kt

Running the Application

Once you’ve completed the setup, build and run your Android application:
Required PermissionsEnsure you’ve added the necessary permissions in your AndroidManifest.xml:

Next Steps

Components Overview

Explore all available UI Kit components and their customization options

Theming

Customize colors, fonts, and styles to match your brand

Integration

Back to the main setup guide

Feature Guides

Add capabilities like threaded messages, blocking, and group management