Yes, that is terrible, and pretty much guaranteed to break.
On Mon, Jul 18, 2011 at 6:54 AM, [email protected] <
[email protected]> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
Dianne Hackborn
Android framework engineer
[email protected]
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en