Q11

Question 11

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

Browse Source Code

Code

Output

Studio Screenshot Main Activity (Login Page) (1/14)
App Screenshot Main Activity (Login Page) (2/14)
Studio Screenshot Taking User Credentials (3/14)
App Screenshot Taking User Credentials (4/14)
Studio Screenshot Validating User With New Activity (Login Activity) (5/14)
App Screenshot Validating User With New Activity (Login Activity) (6/14)
Studio Screenshot Alert Dialog On Pressing Logout Button (7/14)
App Screenshot Alert Dialog On Pressing Logout Button (8/14)
Studio Screenshot (On Pressing No) (9/14)
App Screenshot (On Pressing No) (10/14)
Studio Screenshot Alert Dialog On Pressing Logout Button (11/14)
App Screenshot Alert Dialog On Pressing Logout Button (12/14)
Studio Screenshot (On Pressing Yes) (13/14
Studio Screenshot (On Pressing Yes) (14/14)

Last updated