Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.