Shailendra Madda
Shailendra Madda

Reputation: 21551

How to remove search button soft keyboard in android?

I want to remove the search button from soft keyboard shown in the below image, how to do it? enter image description here

Upvotes: 2

Views: 1643

Answers (2)

iamkdblue
iamkdblue

Reputation: 3632

After searching a lot android:imeOptions="actionNone". add this in your SearchView xml code.

<androidx.appcompat.widget.SearchView
                        android:id="@+id/searchView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:focusable="false"
                        android:imeOptions="actionNone"
                        android:queryBackground="@android:color/transparent"
                        app:iconifiedByDefault="false"
                        app:queryHint="Search Name" />

It replaces with next Line icon, you should try this first. Thanks, me latter.

Upvotes: 2

kmdupr33
kmdupr33

Reputation: 620

In addition to what Bill Gary suggested, you can also call setImeOptions() on the SearchView object.

Upvotes: 0

Related Questions