An utility function that returns the menu identifier for a particular
menu item.
int id = -1;
try {
Integer field = (Integer)cls.getDeclaredField(identifier).get(cls);
id = field.intValue();
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return id;