Code example for MenuInflater

Methods: inflate

0
		} else if (item.getItemId() == achievementsButtonID) {
			showAchievementsList(); 
			return true; 
		} 
		else { 
			return super.onOptionsItemSelected(item);
		} 
	} 
 
	@Override 
	public boolean onCreateOptionsMenu(Menu menu)
	{ 
	    MenuInflater inflater = getMenuInflater();
	    int menuID;
 
	    if(OKManager.INSTANCE.isAchievementsEnabled()) { 
	    	menuID = getResources().getIdentifier("io_openkit_leaderboards", "menu", getPackageName());
	    } else { 
	    	menuID = getResources().getIdentifier("io_openkit_menu_leaderboards_no_achievements", "menu", getPackageName());
		} 
	    inflater.inflate(menuID, menu);