# RecentEmojiProvider

# RecentEmojiProvider

Artifact:[androidx.emoji2:emoji2-emojipicker](https://developer.android.com/jetpack/androidx/releases/emoji2)  
[View Source](https://cs.android.com/search?q=file:androidx/emoji2/emojipicker/RecentEmojiProvider.kt+class:androidx.emoji2.emojipicker.RecentEmojiProvider)  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.4.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/emoji2/emojipicker/RecentEmojiProvider "View this page in Java")

<br />

```
interface RecentEmojiProvider
```

<br />

Known direct subclasses  
[RecentEmojiProviderAdapter](https://developer.android.com/reference/kotlin/androidx/emoji2/emojipicker/RecentEmojiProviderAdapter)  

|-------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| [RecentEmojiProviderAdapter](https://developer.android.com/reference/kotlin/androidx/emoji2/emojipicker/RecentEmojiProviderAdapter) | An adapter for the[RecentEmojiAsyncProvider](https://developer.android.com/reference/kotlin/androidx/emoji2/emojipicker/RecentEmojiAsyncProvider). |

*** ** * ** ***

An interface to provide recent emoji list.

## Summary

|                                                                                    ### Public functions                                                                                    |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `suspend `[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`>` | [getRecentEmojiList](https://developer.android.com/reference/kotlin/androidx/emoji2/emojipicker/RecentEmojiProvider#getRecentEmojiList())`()` Returns a list of recent emojis.                                                                                                          |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                              | [recordSelection](https://developer.android.com/reference/kotlin/androidx/emoji2/emojipicker/RecentEmojiProvider#recordSelection(kotlin.String))`(emoji: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Records an emoji into recent emoji list. |

## Public functions

### getRecentEmojiList

```
suspend fun getRecentEmojiList(): List<String>
```

Returns a list of recent emojis. Default behavior: The most recently used emojis will be displayed first. Clients could also specify the behavior such as displaying the emojis from high click frequency to low click frequency.  

### recordSelection

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/emoji2#1.4.0)  

```
fun recordSelection(emoji: String): Unit
```

Records an emoji into recent emoji list. This fun will be called when an emoji is selected. Clients could specify the behavior to record recently used emojis.(e.g. click frequency).