ViewerActivity question

,

in the ViewerActivity.java of CompleteReader there is the method initViewerLayout() with following lines:

LayoutInflater inflater = getLayoutInflater();
final View mainView = inflater.inflate(R.layout.activity_viewer, null);
setContentView(mainView);

I could see that if I change this for following:
setContentView(R.layout.activity_viewer);

The activity get leaked, each time I would open and close the activity the heap will grow ~8MB
Because avoiding memory leaks in Android is mostly not necessary and it happens strangely I am really interested why this is happening? I suppose that because of the classes being referenced in the layout, but I’m not sure.