• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logout when click in button back of my tablet

 
Sarra Sakka
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i want to know how can i logout from my application when i press the back button in my tablet?
thank you in advance
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add a key listener to your activity like this:

But why would you want to do this, instead of the user staying logged in? I can think of no mobile app where the user gets logged out like that (except for a password app, for obvious reasons). I think that might not go down well with your users.
 
Sarra Sakka
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply,
I use a password in my application that's why ;)
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many apps do - but none log out the user upon quitting the app. I guess if you're the only user you won't have to deal with complaints (but might get tired of it yourself after while...) :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic