# Recent Chat

<figure><img src="/files/DxSZg3N3peWwSKhNXlbf" alt=""><figcaption></figcaption></figure>

## Features

| Feature                    | Description                                                                                                                                   |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Recent chat list           | User can see a list of the most recent chats.                                                                                                 |
| Navigation to Message list | When a user clicks a chat, UIKit opens a [chatroom page](https://docs.amity.co/ui-kit/android/chat/using-only-some-components/chatroom-page). |

## Usage

### **Create a Fragment**&#x20;

```
class MainActivity : AppCompatActivity(), IRecentChatItemClickListener {

   override fun onCreate(savedInstanceState: Bundle?) {
       super.onCreate(savedInstanceState)
       setContentView(R.layout.activity_main)

      val recentChatFragment = AmityRecentChatFragment.newInstance()
      /**
         * set the listener to override recentItem click event
         * No Need to implement [IRecentChatClickListener] if you don't want to override click event
         */
      .recentChatItemClickListener(this)
      .build(this)
        val transaction = supportFragmentManager.beginTransaction()
        transaction.replace(R.id.fragmentContainer, recentChatFragment)
        transaction.addToBackStack(null)
        transaction.commit()
   }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.social.plus/social-plus-uikit/uikit-3/android/chat-uikit/using-only-some-components/chat-home-page/recent-chat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
