Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hilpitome committed Oct 9, 2023
1 parent d854552 commit a36accd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a36accd

Please sign in to comment.