title: How to detect when my app is killed forcefully in android?
body: <p>How to detect when my app close forcefully. I have try some way like service but it's not work proper. Service is close automatically even app in background. Is there any other way to detect app close without using service. </p>
  
  <p>I have try below solution but not working proper.
  <a href="https://stackoverflow.com/questions/19568315/how-to-handle-code-when-app-is-killed-by-swiping-in-android">How to handle code when app is killed by swiping in android?</a></p>
  
  <p>Basically i want to logout only if my app kill forcefully by user.</p>