added in the code from the ActivityInstrumention sample