You are getting the id of your menu item, this is how this is supposed to work.
If you want to check whether a particular item was clicked, compare against the menu item id you declared in R.menu.popupmenu_viewnumber
, e.g.:
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.YourMenuIdHere) {
//Handle item here
}
return false;
}