Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the best way to add a log out button in android

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the best way to add a log out button in android?
I tried with kill the activity? is it good way ?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "log out" mean for the app? Into what would a user be logged in?
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have no clear idia about log out in android as android doesn't maintain session like Web.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you can't articulate what being logged in means, then it's impossible to advise how logging out might work.
 
Maneesh Godbole
Saloon Keeper
Posts: 11331
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ideally the app should have (at a minimum) two sets of functionality. One which is available to logged in users and the second to all users (Of course this is generic, and would solely depend on what your app does)
Logging out would typically take the user to the non logged in functionality screen which can be anything (welcome screen, login screen, whatever.) Again it depends on your application.
Since you are the only one who knows what the application does, its for you to decide.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my app users must login to do anything.But my problem is how to log out after login. Currently i am clicking back button and go to login page.
 
Paul Clapham
Sheriff
Posts: 21576
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which brings us right back to this still unanswered question:

Ulf Dittmer wrote:Into what would a user be logged in?
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
user loged into aapplication.
 
Paul Clapham
Sheriff
Posts: 21576
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay. That was easy after all. So, your logout button should either end the application or take the user to the login page. That would be your choice.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)how to end the application?

2) i tried with direct to login page.But my username and password already there ?how to remove them when i direct to login page ?
 
Maneesh Godbole
Saloon Keeper
Posts: 11331
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the login screen before you start the next activity, clear the login / password so that when the user comes back, its blank.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i direct to login page it work fine.Anyway when i try to login again iti didn't login.I think its related to Oncreate method as it doesn't run twice.

below is my login code

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still have the issue.I added toas messages in on create and on click methods ,when i tried to login 2nd time none of toasts messages were shown.that means it doesn't execute any methods.can anyone please tell me where is the issue ?
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isue resolved now.thanks all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic