A couple of handy apps that you can use are Tasker and Llama, the latter being Free.
You get to run actions based on conditions(and there are loads).
Generally, the logic would look like this.
If Wifi Connected -> Close open apps
Have fun experimenting with these apps!
Originally Posted by TheKingOfQueens
can someone please tell me how to make that my android close all apps when it connects to a new wifi or that it plays sound or music when it connects to new wifi????
on iphone there was a tweak, so i think it will exist for android too?!?