Created
March 25, 2018 13:30
-
-
Save ameliacv/ec4b6956b8b3c1a669066609b3b37119 to your computer and use it in GitHub Desktop.
This file contains 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
holder.mButtonMenu.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
PopupMenu popup = new PopupMenu(mContext, view); | |
//Inflating the Popup using xml file | |
popup.getMenuInflater() | |
.inflate(R.menu.menu_pop_up, popup.getMenu()); | |
//registering popup with OnMenuItemClickListener | |
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { | |
public boolean onMenuItemClick(MenuItem item) { | |
if (item.getItemId() == R.id.menu_edit) { | |
// WHEN MENU CLIC | |
} | |
return true; | |
} | |
}); | |
popup.show(); //showing popup menu | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment