created MyActivity and moved some functional to it.