Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

menuItem.setIcon not working in floatingSearchView.setOnMenuItemClickListener #243

Open
dmitryermichev opened this issue Jun 5, 2017 · 4 comments

Comments

@dmitryermichev
Copy link

dmitryermichev commented Jun 5, 2017

I want to change menu icon in floatsearchview, for example:

floatingSearchView.setOnMenuItemClickListener(new FloatingSearchView.OnMenuItemClickListener() {
            @Override
            public void onActionMenuItemSelected(MenuItem item) {
                if(item.getItemId() == R.id.action_location) {
                    if(locationEnabled) {
                        item.setIcon(R.drawable.ic_action_location_disabled);
                        locationEnabled = false;
                        Log.d(this.getClass().getName(), "location disabled");
                    } else {
                        item.setIcon(R.drawable.ic_action_location);
                        locationEnabled = true;
                        Log.d(this.getClass().getName(), "location enabled");
                    }
                }
            }
        });

Icon not changing. I can't find any methods like invalidate(), or something like this.

@randomlock
Copy link

Any solution ?

@Naguchennai
Copy link

i also need this

@Naguchennai
Copy link

Any solution? Any hell?

@wqqgt
Copy link

wqqgt commented Dec 20, 2019

me to, so I change style to tab for replaced menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants