Added lifecycle hooks to LogGraphSurfaceView to enable thread management within that class.