title: how to end session of an android application in an efficient way?
body: <p>i would like to close all the connection to the server side when application crashes. The application runs a main activity which holds my menu. under this activity there are at least 7 fragments and i would like that if the application crashes, all the connections of the current session will be terminated. I know there is the onDestroy method but i am not sure how to use it or if it will solve my problem.</p>
  
  <p>in addition i already implemented a logout() function but it will be executed in case the user clicked on logout.</p>