検索ビューコンポーネントに表示される白色のドローアブルのXマークを変更したいのですが、どうすれば変更できますか? 私を助けてください。ありがとう。
SearchManager searchManager = (SearchManager)getSystemService(Context.SEARCH_SERVICE);
searchView = (SearchView)menu.findItem(R.id.ac_search).getActionView();
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setIconifiedByDefault(true);
try{
Field searchField = SearchView.class.getDeclaredField("mSearchButton");
searchField.setAccessible(true);
ImageView searchBtn = (ImageView)searchField.get(searchView);
searchBtn.setImageResource(R.drawable.ac_search);
searchField = SearchView.class.getDeclaredField("mSearchPlate");
searchField.setAccessible(true);
LinearLayout searchPlate = (LinearLayout)searchField.get(searchView);
searchPlate.setBackgroundResource(R.drawable.search_edit_text_holo_light);
AutoCompleteTextView searchText = (AutoCompleteTextView) searchView.findViewById(R.id.abs__search_src_text);
searchText.setHintTextColor(getResources().getColor(android.R.color.white));
searchText.setHint(R.string.ac_search_here);
searchText.setTextColor(getResources().getColor(android.R.color.white));
}catch (NoSuchFieldException e){}catch (IllegalAccessException e){}