Do you doubt the inflate concept?

2
public boolean onCreateOptionsMenu(Menu miMenu){
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.mi_menu, miMenu);

    return true;
}

Data this code What does inflate () really mean? I understand that the first parameter is your created menu but as this inflate method is explained with the second parameter, what is this method supposed to do with that Menu object?

    
asked by Reductor 28.09.2017 в 11:42
source

1 answer

3

"Inflating" a layout would be the process by which you associate a view, in this case, the menu, its corresponding layout, which you will have saved in an XML.

In this case, in the first parameter you would pass the layout R.menu.mi_menu where you would have defined the options that your menu will have and, in the second parameter, you would pass your menu to associate that XML with the menu view.

    
answered by 28.09.2017 / 12:15
source