title: how to clear background data when sign out
body: <p>I have been writing a multiple accounts manage module. What I want to do is to lead user to Accounts list activity when signing out. The problems is when user press back button, it resumed the background activity and user still can use the app even signed out. And it doesn`t work either when I cleared account info in database and SharedPreference.</p>
  
  <p>For better understanding I describe the problem again.</p>
  
  <p>For example, I have three activities, A, B and C. A works as main activity with a list, B works as the settings menu activity and C works as the account list Activity.  </p>
  
  <p>When I navigate from A to B click "Sign Out" menu in B, then the process flow goes from B to C.
  Because it asks user to choose (if has) or login an account.</p>
  
  <p>Now the problem is when user press back button, it can go back from C to A rather than exit the app (go to home screen). See the screenshot blow.<img src="https://i.stack.imgur.com/RoDlr.png" alt="enter image description here"></p>
  
  <p>Since user already signed out, I doesn`t make sense to navigate back from C to A. C should be the only visible Activity at this circumstance.</p>
  
  <p>But I don`t know how to implement this, I already clear account info in local storage, so it should not be the settings problem. </p>
  
  <p>So how to clear the background activity A?</p>
  
  <p>Any comments will be greatly appreciated.</p>