总是在SearchView中显示麦克风图标

在Android可search的SearchView中,清除(X)图标replace了打字时的麦克风图标。 我想在input时显示清晰和麦克风图标。 有没有办法做到这一点?

这是我的代码:

RES / XML / searchable.xml

<searchable xmlns:android="http://schemas.android.com/apk/res/android" android:hint="@string/search_hint" android:label="@string/app_name" android:searchMode="queryRewriteFromText" android:voiceSearchMode="showVoiceSearchButton|launchRecognizer" android:voiceLanguageModel="web_search" android:searchSuggestIntentAction="android.intent.action.VIEW" /> 

RES /布局/ menu_search.xml

 <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto" <item android:id="@+id/search" android:title="search here" android:icon="@android:drawable/ic_menu_search" app:showAsAction="collapseActionView|ifRoom" app:actionViewClass="android.support.v7.widget.SearchView" /> </menu> 

MainActivity.java

 @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_search, menu); MenuItem searchItem = menu.findItem(R.id.search); searchView = (SearchView) MenuItemCompat.getActionView(searchItem); searchView.setOnQueryTextListener(this); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); searchView.setSearchableInfo(searchManager.getSearchableInfo( getComponentName() )); searchView.setIconifiedByDefault(false); searchView.setQueryRefinementEnabled(true); return true; } 

AndroidManifest.xml中

 <activity android:name=".MainActivity" android:launchMode="singleTop"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <action android:name="android.intent.action.SEARCH" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> </activity> 

提前致谢。

Solutions Collecting From Web of "总是在SearchView中显示麦克风图标"