ViewerActivity question


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

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

I could see that if I change this for following:

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.