diff --git a/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java b/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java index 2e3431f853..3a9725d5e3 100644 --- a/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java +++ b/opensrp-chw/src/lmh/java/org/smartregister/chw/application/ChwApplicationFlv.java @@ -195,4 +195,9 @@ public boolean showFamilyRegisterNextInToolbar() { public boolean onFamilySaveGoToProfile() { return true; } + + @Override + public boolean onChildProfileHomeGoToChildRegister() { + return false; + } } diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/activity/ChildProfileActivity.java b/opensrp-chw/src/main/java/org/smartregister/chw/activity/ChildProfileActivity.java index e0ae79b165..c5c2d90ca0 100644 --- a/opensrp-chw/src/main/java/org/smartregister/chw/activity/ChildProfileActivity.java +++ b/opensrp-chw/src/main/java/org/smartregister/chw/activity/ChildProfileActivity.java @@ -156,10 +156,13 @@ private String getEligibleChildString() { public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: - Intent intent = new Intent(this, ChildRegisterActivity.class); - startActivity(intent); - finish(); - return true; + if (ChwApplication.getApplicationFlavor().onChildProfileHomeGoToChildRegister()) { + Intent intent = new Intent(this, ChildRegisterActivity.class); + startActivity(intent); + finish(); + return true; + } + return super.onOptionsItemSelected(item); case R.id.action_malaria_registration: MalariaRegisterActivity.startMalariaRegistrationActivity(ChildProfileActivity.this, presenter().getChildClient().getCaseId(), ((ChildProfilePresenter) presenter()).getFamilyID()); return true; diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java b/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java index 2881b389e3..1548749728 100644 --- a/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java +++ b/opensrp-chw/src/main/java/org/smartregister/chw/application/ChwApplication.java @@ -457,6 +457,8 @@ public interface Flavor { boolean onFamilySaveGoToProfile(); + boolean onChildProfileHomeGoToChildRegister(); + } } diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java b/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java index e8202ee4ea..f7bd0c6681 100644 --- a/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java +++ b/opensrp-chw/src/main/java/org/smartregister/chw/application/DefaultChwApplicationFlv.java @@ -253,4 +253,9 @@ public boolean showFamilyRegisterNextInToolbar() { public boolean onFamilySaveGoToProfile() { return false; } + + @Override + public boolean onChildProfileHomeGoToChildRegister() { + return true; + } }