title: App is stuck/breaks in onResume or onPause
body: <p>So I made an app which uses sockets, buffered readers etc. to communicate with a server. Everything works, but when I unfocus the app (by pressing that "show me all of the running apps" button) and then refocus it, it is frozen. I tried to close the sockets, readers etc. in onPause, and I tried it without even overriding the onPause method (and onResume).</p>
  
  <p>I basically want the app to return to the main activity as soon as it looses focus, but I can't just finish the current activity (because then the app freezes when you focus it again, too).</p>
  
  <p>What do I have to do? 
  I would provide some code, but I don't think that it would be helpful for the question. But if you need some, tell me and I will post it.</p>