From 1048e5947110a54be6221712bfb68949ebb3b0bb Mon Sep 17 00:00:00 2001 From: andresmr Date: Tue, 26 Nov 2024 15:20:35 +0100 Subject: [PATCH] fix: [ANDROAPP-6691] Null pointer on show dialog Signed-off-by: andresmr --- .../usescases/datasets/dataSetTable/DataSetTableActivity.kt | 3 +-- .../programEventDetail/ProgramEventDetailActivity.kt | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/dhis2/usescases/datasets/dataSetTable/DataSetTableActivity.kt b/app/src/main/java/org/dhis2/usescases/datasets/dataSetTable/DataSetTableActivity.kt index b16f784076..07870ed8a1 100644 --- a/app/src/main/java/org/dhis2/usescases/datasets/dataSetTable/DataSetTableActivity.kt +++ b/app/src/main/java/org/dhis2/usescases/datasets/dataSetTable/DataSetTableActivity.kt @@ -184,9 +184,8 @@ class DataSetTableActivity : ActivityGlobalAbstract(), DataSetTableContract.View } }) .onNoConnectionListener { - val contextView = findViewById(R.id.navigationBar) Snackbar.make( - contextView, + binding.root, R.string.sync_offline_check_connection, Snackbar.LENGTH_SHORT, ).show() diff --git a/app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailActivity.kt b/app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailActivity.kt index 642fbe283d..3fac0ea471 100644 --- a/app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailActivity.kt +++ b/app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailActivity.kt @@ -273,9 +273,8 @@ class ProgramEventDetailActivity : } }) .onNoConnectionListener { - val contextView = findViewById(R.id.navigationBar) Snackbar.make( - contextView, + binding.root, R.string.sync_offline_check_connection, Snackbar.LENGTH_SHORT, ).show() @@ -524,9 +523,8 @@ class ProgramEventDetailActivity : } }) .onNoConnectionListener { - val contextView = findViewById(R.id.rootView) Snackbar.make( - contextView, + binding.root, R.string.sync_offline_check_connection, Snackbar.LENGTH_SHORT, ).show()