I implemented SearchViewactivity in the action bar, and it works great and will display as expected in Galaxy Nexus and most emulators. However, on Galaxy Note 10.1 and emulators with tablet-sized screens it looks like this:

As you can see, the search icon is much smaller than other icons. How can I get the search icon icon according to other icons? Or how can I format icon sizes on large screens?
At first I thought that perhaps the problem may be related to the size of the extracted file, but after checking, I can confirm that the icons consistently exist in the resources folder drawable-hdpi, drawable-mdpiand drawable-xhdpiare the same size as the other menu icons. I used this tool to create drawings, and there are no errors in the size of any of the drawings. I even tried using the same drawing as one of the other menu icons, and the resulting size difference is the same.
The icon remains the same size as the opening SearchView(this is normal, because otherwise it may overlap the underline of the view EditText), but when SearchViewit closes again, the icon is the same size and still much smaller than the rest of the icons, and this may be the key to Why is this happening.
Operation code:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.example, menu);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
SearchManager manager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
final SearchView search = (SearchView) menu.findItem(R.id.search).getActionView();
final MenuItem item = menu.findItem(R.id.search);
search.setSearchableInfo(manager.getSearchableInfo(getComponentName()));
} else {
menu.removeItem(R.id.search);
}
return true;
}
Res / menu / example.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/search"
android:title="@string/search"
android:icon="@drawable/search"
android:showAsAction="ifRoom"
android:actionViewClass="android.widget.SearchView" />
</menu>
Res / xml / searchable.xml
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/search"
android:hint="@string/search" >
</searchable>
AndroidManifest.xml
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.default_searchable"
android:value="com.example.ExampleActivity" />
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
UPDATE:
Sorry this problem was really related to the drawings. In particular, the size ratio of the menu icons. The menu icons hdpi-drawablewere all 64x64 (x2), when they were supposed to be 48x48 (x1.5).
Thus, this problem can be solved by changing all the menu icons mdpi-drawableto 32x32 and hdpi-drawable48x48 and xhdpi-drawable64x64 (thanks @rekire for this suggestion).
. , , .