Handled case of device giving output as "FINE" on first run sometimes.

This commit is contained in:
vsuryakumar
2023-02-01 13:05:16 +05:30
parent fed35cc54d
commit 4e19f6f337

View File

@@ -7,6 +7,7 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import com.example.hpos.R
@@ -73,7 +74,7 @@ class TestRightExpReference : Fragment() {
override fun onClickBtnTwo() {
// Todo: Only for testing
viewModel.progressBar.postValue(true)
// viewModel.progressBar.postValue(true)
}
})
}
@@ -127,12 +128,11 @@ class TestRightExpReference : Fragment() {
)
viewModel.mapDeviceConstants(fullReadOutput.toString())
viewModel.progressBar.postValue(false)
} else if (stringData.contains("FINE", true)){
Log.d(TAG, "results = FINE")
viewModel.progressBar.postValue(false)
Toast.makeText(requireContext(), "Please try again this step", Toast.LENGTH_SHORT).show()
}
// else if (recursive && stringData.contains("FINE", true)){
// Log.d(TAG, "results = FINE and calling again")
// viewModel.progressBar.postValue(false)
// sendCmdToFetchDeviceConstant(false)
// }
}
}