Add WriteToText to mainActivity