Create a login application as above, on successful login redirect to another activity without logout button a dialog appears with OK and CANCEL button. On OK button click go to login activity and on CANCEL stay at same activity.
App Insights:
Used functional code of previous program with hard coded credentials, added a login activity on successful login, used DialogInterface and AlertDialog for logout functionality