add custom layout in menu item android : I want to add custom layout to the menuitem in menu.xml file.

 LinearLayout actionItemLayout = (LinearLayout) menu.findItem(R.id.itemMenu).getActionView();
        TextView txtNumber = (TextView)actionItemLayout.findViewById(R.id.txt_vehicleNumber);
        TextView txtName = (TextView)actionItemLayout.findViewById(R.id.txt_vehicleName);

I havedone like this but everytime actionItemLayout is giving null.

Please help