Skip to content

Commit

Permalink
fix 'add new family' to check instance from class
Browse files Browse the repository at this point in the history
  • Loading branch information
LZRS committed Oct 5, 2021
1 parent 7b08848 commit 25cd03a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ public void onClick(View v) {
activity.finish();
break;
case CoreConstants.DrawerMenu.ADD_NEW_FAMILY:
if (activity instanceof BaseRegisterActivity) {
Class<?> newFamilyRegisterClass = getActivity(CoreConstants.REGISTERED_ACTIVITIES.ADD_NEW_FAMILY);
if (newFamilyRegisterClass.isInstance(activity)) {
BaseRegisterActivity baseRegisterActivity = (BaseRegisterActivity) activity;
baseRegisterActivity.startRegistration();
} else {
Intent intent = new Intent(activity, getActivity(CoreConstants.REGISTERED_ACTIVITIES.REPORTS_ACTIVITY));
Intent intent = new Intent(activity, newFamilyRegisterClass);
intent.putExtra(CoreConstants.ACTIVITY_PAYLOAD.ACTION, CoreConstants.ACTION.START_REGISTRATION);
activity.startActivity(intent);
}
Expand Down

0 comments on commit 25cd03a

Please sign in to comment.