Yep, I'm 100% with you. It would be ideal if the system handled these focus quirks, ie. if the app initiates an activity, close any keyboard that the app itself opened and prevent the app from taking focus while the activity is in progress.