Yes, that is terrible, and pretty much guaranteed to break. On Mon, Jul 18, 2011 at 6:54 AM, dmitry.lukas...@gmail.com < dmitry.lukas...@gmail.com> wrote:
> I've found only one way to change default search view icon:-) But this is > terrible solution > > SearchView sv = new SearchView(mActivity); > sv.setOnQueryTextListener(mOnSearchQueryTextListener); > menuItemSearch.setActionView(sv); > searchViewChangeHack(sv); > > private static int sViewIndex = 0; > > private void searchViewChangeHack(ViewGroup sv) { > for (int i = 0; i < sv.getChildCount(); i++) { > View v = sv.getChildAt(i); > if (v instanceof ViewGroup) { > searchViewChangeHack((ViewGroup)v); > } else if (v instanceof ImageView) { > if (sViewIndex == 0 || sViewIndex == 1) { > ((ImageView) > v).setImageResource(R.drawable.common_bar_search); > } > sViewIndex++; > > } > } > } > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en