mancj / mancj/MaterialSearchBar

Solving on Menu Item click

Open
#150 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
324
PR merge metrics
No merged PRs in 30d

Description

`
searchbar.inflateMenu(R.menu.menu_main);
`
`
searchbar.getMenu().setOnMenuItemClickListener(this);
`
Then implement `PopupMenu.OnMenuItemClickListener`
Finally:

`
@Override
public boolean onMenuItemClick ( MenuItem item )
{
int id = item.getItemId ( );
switch ( id )
{
case R.id.menu_theme:
ThemeUtils.setAppTheme( this );
break;

case R.id.menu_settings:
NavigationUtils.openActivity (this , SettingsActivity.class);
break;

}
return true;
}
`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the searchbar menu integration and the use of searchbar.inflateMenu(R.menu.menu_main) with searchbar.getMenu().setOnMenuItemClickListener(this). Review how PopupMenu.OnMenuItemClickListener and the menu_theme and menu_settings item IDs are handled; done means the requested menu-item click behavior is supported and verified in the Android project.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.