Android
Search Input View
Confused about "Search Input View"?
Let us know how we can improve our documentation:
LAST EDIT Feb 17 2021
- On This Page:
- Adding the layout
- Handling User Interactions
SearchInputView
is a widget that provides a user interface for the user to enter a search query and submit it:

Adding the layout
Copied!Confused about "Adding the layout "?
Let us know how we can improve our documentation:
1
2
3
4
<io.getstream.chat.android.ui.search.SearchInputView
android:id="@+id/searchInputView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Handling User Interactions
Copied!Confused about "[object Object]"?
Let us know how we can improve our documentation:
It is possible to listen for query text changes within the SearchInputView
, by using listeners:
1
2
3
4
5
6
7
8
9
searchInputView.setContinuousInputChangedListener {
// Search query changed
}
searchInputView.setDebouncedInputChangedListener {
// Search query changed and has been stable for a short while
}
searchInputView.setSearchStartedListener {
// Search is triggered
}
1
2
3
4
5
6
7
8
9
searchInputView.setContinuousInputChangedListener(query -> {
// Search query changed
});
searchInputView.setDebouncedInputChangedListener(query -> {
// Search query changed and has been stable for a short while
});
searchInputView.setSearchStartedListener(query -> {
// Search is triggered
});
A full list of available listeners to set can be found here.
The search query can be also updated programmatically:
1
2
3
4
// Update the current search query programmatically
searchInputView.setQuery("query")
// Clear the current search query programmatically
searchInputView.clear()
1
2
3
4
// Update the current search query programmatically
searchInputView.setQuery("query");
// Clear the current search query programmatically
searchInputView.clear();