A client of mine has some proprietary android devices that he needs to lock the settings for. Basically he wants a service that will detect when the settings activity is in the foreground and switch to a "type your password" activity which will then allow the settings app to be run if the password is correct.
My question is simply how can I detect when another application is in the foreground? As a follow-up, is there a simple way to bring my application to the front when this is detected?