It's a bit unexpected to find this piece of code here. Why not make a new activity for this operation?