# Recent Chat

<figure><img src="https://2352509137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX0mOAVWkotGme0iRzu%2Fuploads%2FQKh78yvVuHHGp5BPjulW%2FScreenshot%202566-02-22%20at%2012.55.11.png?alt=media&#x26;token=99404ffc-e0a6-4ddc-b04f-d7ff419c36f5" 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()
   }
}
```
