Note that there are some explanatory texts on larger screens.

plurals
  1. POSearch View uses app icon instead of logo
    primarykey
    data
    text
    <p>Android documents explain that app logo is used everywhere when it is defined. But when the search view expands, app icon is used instead of app logo and I can't find a way to show app logo when search view is in expanded state.</p> <p>Here are the relevant parts.</p> <p>Manifest file</p> <pre><code>&lt;application android:name="MyApp" android:allowBackup="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:logo="@drawable/app_logo" android:theme="@style/Theme.MyTheme" &gt; </code></pre> <p>searchable.xml (setting icon doesn't change anything)</p> <pre><code>&lt;searchable xmlns:android="http://schemas.android.com/apk/res/android" android:icon="@drawable/app_logo" android:label="@string/app_name" android:hint="@string/search_hint" &gt; &lt;/searchable&gt; </code></pre> <p>menu.xml</p> <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:id="@+id/menu_search" android:actionViewClass="com.actionbarsherlock.widget.SearchView" android:icon="@drawable/ic_search" android:showAsAction="always|collapseActionView" /&gt; </code></pre> <p>Activity Code</p> <pre><code>SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = new SearchView(getSupportActionBar().getThemedContext()); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); menu.findItem(R.id.menu_search).setActionView(searchView); </code></pre> <p><strong>NOTE:</strong> I use ABS SearchView but same thing happens when I switch to default SearchView. </p> <p><strong>EDIT :</strong> I added some screenshots for clarity.</p> <p>Here I used the star image for app logo, and android image for app icon. The first screenshot is the default view of activity. The second one is the view when I click search button. It shows the android image while I expect it to be the star image.</p> <p><img src="https://i.stack.imgur.com/sZuxD.jpg" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/3rZM6.jpg" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload