From the course: Building Android Apps with AWS

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Set up user sign out

Set up user sign out

From the course: Building Android Apps with AWS

Start my 1-month free trial

Set up user sign out

- [Instructor] Now that we can sign into our ListMaker app using an email address, the next thing that I'm gonna add is the ability to sign out. And we don't actually need to set up anything different in the backend to implement the sign out feature, we just need to use the SDK to call the appropriate methods to handle signing out. So I wanna add a sign out button to the action bar. So I'm starting here in the menu resource for the main activity and I'm just gonna add a menu item. I'm gonna call that menu_main_signout. And I want the title just to be Sign Out. And then under showAsAction, I'm just gonna make sure to select ifRoom and withText. So now I can go into the main activity and I wanna handle the action for that menu item. So I just need to override the onOptionsItemsSelected method and I just like to make sure that I check and make sure what the item is, even though we only have one item. I wanna make sure it's the right one. And then right here is where we need to be able to…

Contents