How to record flights and cockpit radio com using an Android phone?
Android by default has Google Now enables, which include voice search. Voice search listens for the words "Ok Google" when you speak, but phones also detect a long press in a headphone button (on headphones with controls). It can also be fooled into activating by odd signals like the pop when you turn on the avionics master switch or loud droning noises like motorcycle and airplane engines. 

First thing I would try is to turn off the voice detection, see this page for instructions. Now google voice should stop popping up if the phone is being fooled by noise.  

However, that may not be the end of it if the phone is detecting static or other signals as a long headphone control press, in which case it may still interrupt your setup. In that case you will need to use an app to disable the headphone controls, the one I've heard of is SoundAbout, or your phone's distribution may have settings to let you do it.