Ondestroy method created in MainActivity.
Updated Mainactivity to include OnDestroy method.