diff --git a/app/src/main/java/com/example/hpostesting/presentation/testRight/TestRightResults.kt b/app/src/main/java/com/example/hpostesting/presentation/testRight/TestRightResults.kt index 033c5bd..2916463 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/testRight/TestRightResults.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/testRight/TestRightResults.kt @@ -65,34 +65,26 @@ class TestRightResults : Fragment() { private fun setupListeners() { binding.ivHome.setOnClickListener { CoroutineScope(Dispatchers.IO).launch { - // Get the text from the EditText val bloodGroupText = binding.etBloodGroup.text.toString() - if (bloodGroupText.isNullOrBlank() || bloodGroupText == "Select Blood Group") { - // Show error on EditText withContext(Dispatchers.Main) { binding.etBloodGroup.error = "Please enter your blood group" } - // Show toast message withContext(Dispatchers.Main) { Toast.makeText(context, "Please enter your blood group", Toast.LENGTH_SHORT).show() } } else { - // No error, continue with the logic + withContext(Dispatchers.Main) { + binding.etBloodGroup.error = null + } bloodGroup = bloodGroupText checkBloodGroup() } } } - // Rest of your code... - - - // Rest of your code... - binding.ivNext.setOnClickListener { val i = Intent(requireContext().applicationContext, DashboardActivity::class.java) startActivity(i) -// moveToSamplePage() } }