diff --git a/gradle.properties b/gradle.properties index e529019..fb8d910 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=1.0.5-SNAPSHOT +VERSION_NAME=1.0.6-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Growth Monitoring Application diff --git a/opensrp-growth-monitoring/src/main/java/org/smartregister/growthmonitoring/fragment/GrowthDialogFragment.java b/opensrp-growth-monitoring/src/main/java/org/smartregister/growthmonitoring/fragment/GrowthDialogFragment.java index 581304b..84a4ac0 100644 --- a/opensrp-growth-monitoring/src/main/java/org/smartregister/growthmonitoring/fragment/GrowthDialogFragment.java +++ b/opensrp-growth-monitoring/src/main/java/org/smartregister/growthmonitoring/fragment/GrowthDialogFragment.java @@ -541,7 +541,15 @@ public void onStart() { new Handler().post(new Runnable() { @Override public void run() { - Window window = getDialog().getWindow(); + Window window = null; + if (getDialog() != null) { + window = getDialog().getWindow(); + } + + if (window == null) { + return; + } + Point size = new Point(); Display display = window.getWindowManager().getDefaultDisplay(); diff --git a/opensrp-growth-monitoring/src/main/java/org/smartregister/growthmonitoring/fragment/RecordWeightDialogFragment.java b/opensrp-growth-monitoring/src/main/java/org/smartregister/growthmonitoring/fragment/RecordWeightDialogFragment.java index 6eaee7f..d434034 100644 --- a/opensrp-growth-monitoring/src/main/java/org/smartregister/growthmonitoring/fragment/RecordWeightDialogFragment.java +++ b/opensrp-growth-monitoring/src/main/java/org/smartregister/growthmonitoring/fragment/RecordWeightDialogFragment.java @@ -10,6 +10,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.Window; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.DatePicker; @@ -244,14 +245,23 @@ private void formatEditWeightView(EditText editWeight, String userInput) { @Override public void onStart() { super.onStart(); - // without a handler, the window sizes itself correctly + // without a handler, the window size itself correctly // but the keyboard does not show up new Handler().post(new Runnable() { @Override public void run() { - getDialog().getWindow().setLayout(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); + Window window = null; + if (getDialog() != null) { + window = getDialog().getWindow(); + } + + if (window == null) { + return; + } + window.setLayout(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); } + }); }