![]() ![]() Now that we do, we'll need to remove the "NoActionBarTheme" previously applied to the MainActivity. Several weeks ago, we hid the app bar in the MainActivity of MyRestaurants (as seen in this lesson) because we simply didn't have any menu options to display yet. There's still one more step we must complete. Now, we won't be able to see the logout option in our overflow menu quite yet. Here, we create a new Intent to return the user to the LoginActivity, add flags to remove the current activity from our stack, start the new Intent, and end the current instance of MainActivity with the finish() method. tFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK) ![]() Intent intent = new Intent(MainActivity.this, LoginActivity.class) ![]()
0 Comments
Leave a Reply. |