added camerastatus.txt file status1 is flag2....

Look for it in your video class and on finding it call
motiondetectionactivity .pause() and after recording call resume()