So I am trying to create a menu with a video in the background for my program. When you click on one of the buttons on the menu a new layout is loaded, a video plays and then it returns to this original menu.
I attached an image of what code I have to implement this.
The problem is, every time this happens my memory usage goes up by about 30 MB. It's like nothing is being release from memory and the same thing is being loaded into memory over and over again. Eventually the RAM usage gets so high that the program crashes...
How do I get the layout to be unloaded from memory so that my RAM usage stays manageable?