Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Logging Out

How to add logout button in Android studio

How to add logout button in Android studio

2 Answers

alex gwartney
alex gwartney
8,849 Points

well the first thing you would want to do is to set up something like parse if you are using a back end service. But to just get a simple button just got the xml view and drag a button widget on the screen give it a id and then in your on create method you can make a on click listner. The on click listener then would set up for the functionality for logging a user out once you set up some sort of log out code.

Jacob Bergdahl
Jacob Bergdahl
29,118 Points

Follow along the track and this will be covered. The Ribbit project will teach you all you need to know about logging users out.