Fix for add new patient nav bar, onclick functionality #379
Fix for add new patient nav bar, onclick functionality #379sakthiarajapandian27 wants to merge 1 commit intomasterfrom
Conversation
KudratAroraa
left a comment
There was a problem hiding this comment.
Approved. I tested this locally and confirmed that the issue has been resolved as intended. In the Admin user flow, after going to Add New Patient, the side navigation bar is now responding correctly on click. The Home option navigates back to the admin homepage as expected, and the Signout option now properly signs the user out, redirects to the login screen, and clears the activity back stack so the user cannot navigate back into the session.
The implementation is clean and focused on the reported bug. Adding the setNavigationItemSelectedListener in this activity directly addresses the missing navbar click handling without introducing unrelated changes. The logout handling is also correctly implemented using Firebase sign out together with FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK, which is appropriate for this flow.
Overall, the fix works as expected, aligns with the intended functionality and is ready to merge.
Small thing to note:
This is not a blocker for this PR, but worth mentioning:
Home navigation may stack duplicate screens: If admin is already deep in the flow and taps Home multiple times, this can create multiple Homepage4admin instances unless launch mode or intent flags handle it elsewhere.
Possible improvement:
Intent homeIntent = new Intent(PatientProfileAddActivity.this, Homepage4admin.class);
homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(homeIntent);
Description
Initially in admin user, the new patient functionalities nav bar onclick functionality was not working. Fix for it.
Todos
How to test
Login as admin -> At home page click add new patient -> click the side nav bar -> Onclick of home and Signout fixed
Associated MS Planner Tasks