Search code examples
androidandroid-search

android searchview how show same image


<android.widget.SearchView
        android:id="@+id/sv"
        android:title="Search aaaa"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="@dimen/widget_store_promotions_header_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

result :enter image description hereenter image description here

how show searchview same bellow : enter image description here


Solution

  • you have to use this setting in your searchview xml

    android:queryHint="your hint"
    android:iconifiedByDefault="false"
    

    by using android:iconifiedByDefault="false" the searchview shows the edit text also