Created
June 8, 2018 09:23
-
-
Save exhesham/1688421cd46118dd0b2209546f9a8027 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
int itemThatWasClickedId = item.getItemId(); | |
if (itemThatWasClickedId == R.id.action_search) { | |
Context context = MainActivity.this; | |
String textToShow = "Search clicked"; | |
Toast.makeText(context, textToShow, Toast.LENGTH_SHORT).show(); | |
return true; | |
} | |
return super.onOptionsItemSelected(item); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment