diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/activities/JsonFormBaseActivity.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/activities/JsonFormBaseActivity.java index c1f9aaa5f..525c7d539 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/activities/JsonFormBaseActivity.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/activities/JsonFormBaseActivity.java @@ -188,6 +188,10 @@ public void setmJSONObject(JSONObject mJSONObject) { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { + Timber.e("JsonFromBaseActivity optib requestCode %s resultCode %s", requestCode, resultCode); + if(data != null) + Timber.e(" data %s",data.getStringExtra(Intent.EXTRA_TEXT)); + else Timber.e("JsonFormBaseActivity data is null"); if (onActivityResultListeners.containsKey(requestCode)) { onActivityResultListeners.get(requestCode).onActivityResult(requestCode, resultCode, data); } else { diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java index a4ed99291..44e96c1d4 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java @@ -146,6 +146,7 @@ private Button initLaunchButton(LinearLayout rootLayout, final WidgetArgs widget Timber.w(" ONCLICK WITH JSON %s", jsonObject); Intent intent = new Intent(OptibpConstants.OPTIBP_LAUNCH_INTENT); intent.setType("text/json"); + Timber.e("OptibpWidget factory sending request %s", getInputJsonString(context, jsonObject, widgetArgs)); intent.putExtra(Intent.EXTRA_TEXT, getInputJsonString(context, jsonObject, widgetArgs)); ((Activity) context).startActivityForResult(Intent.createChooser(intent, ""), requestCode); } catch (Exception e) { @@ -182,9 +183,14 @@ private void formatButtonWidget(Button button, JSONObject jsonObject) throws JSO public void setUpOptiBpActivityResultListener(final WidgetArgs widgetArgs, int requestCode, final LinearLayout rootLayout, EditText systolicEditText, final EditText diastolicEditText) { final Context context = widgetArgs.getContext(); + if (context instanceof JsonApi) { final JsonApi jsonApi = (JsonApi) context; jsonApi.addOnActivityResultListener(requestCode, (finalRequestCode, resultCode, data) -> { + Timber.e("OptibpWidgetFactory optib requestCode %s resultCode %s", requestCode, resultCode); + if(data != null) + Timber.e("OptibpWidgetFactory data %s",data.getStringExtra(Intent.EXTRA_TEXT)); + else Timber.e("OptibpWidgetFactory data is null"); if (resultCode == Activity.RESULT_OK) { if (finalRequestCode == OptibpConstants.OPTIBP_REQUEST_CODE || finalRequestCode == OptibpConstants.OPTIBP_REPEAT_REQUEST_CODE) { diff --git a/gradle.properties b/gradle.properties index 40958f5b4..3426598f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=3.1.4-DEV-SNAPSHOT +VERSION_NAME=3.1.7-DEV-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Native Form Json Wizard