diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/fragments/JsonFormFragment.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/fragments/JsonFormFragment.java index 895fe3330..eae402c0e 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/fragments/JsonFormFragment.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/fragments/JsonFormFragment.java @@ -482,6 +482,21 @@ public boolean next() { return false; } + + public Runnable nextAsRunnable() { + return new Runnable() { + @Override + public void run() { + try { + presenter.onNextClick(mMainView); + } catch (Exception e) { + Timber.e(e, " --> next"); + } + } + }; + + } + public void setShouldSkipStep(boolean shouldSkipStep) { this.shouldSkipStep = shouldSkipStep; } diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/task/NextProgressDialogTask.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/task/NextProgressDialogTask.java index 76b4e18e7..935c05296 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/task/NextProgressDialogTask.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/task/NextProgressDialogTask.java @@ -10,6 +10,7 @@ public class NextProgressDialogTask extends AsyncTask { private JsonWizardFormFragment formFragment; private Context context; private ProgressDialog progressDialog; + private Runnable runnableOnUiThread; private void showDialog() { setProgressDialog(new ProgressDialog(getContext())); @@ -34,7 +35,7 @@ public NextProgressDialogTask(JsonWizardFormFragment jsonFormFragment) { @Override protected Void doInBackground(Void... voids) { - getFormFragment().next(); + runnableOnUiThread = getFormFragment().nextAsRunnable(); return null; } @@ -48,6 +49,10 @@ protected void onPreExecute() { protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); hideDialog(); + + if (runnableOnUiThread != null) { + runnableOnUiThread.run(); + } } public JsonWizardFormFragment getFormFragment() { diff --git a/gradle.properties b/gradle.properties index fec4378b0..10b03564b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=2.1.14-SNAPSHOT +VERSION_NAME=2.1.14.1-GIZ-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Native Form Json Wizard