Code example for MenuInflater

0
package com.google.code.astarz.view; 
 
 
import android.app.Activity; 
import android.content.Context; 
import android.view.Menu; 
import android.view.MenuInflater; 
 
public class MenuHelper { 
    public static void inflateAndInject(Context ctx, int resource, Menu menu, Object target) {
        new MenuInflater(ctx).inflate(resource, menu);
        InjectByMenu.inject(menu, target);
    } 
     
    public static void inflateAndInjectActivity(Activity activity, int resource, Menu menu) {
        inflateAndInject(activity, resource, menu, activity);
    } 
}