Fix ANR in Profile Helper by moving slow TDD calc into separate thread #868
This commit is contained in:
parent
5d3035c09c
commit
4c19b2006e
|
@ -168,7 +168,11 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() {
|
||||||
|
|
||||||
binding.basalpctfromtdd.setParams(32.0, 32.0, 37.0, 1.0, DecimalFormat("0"), false, null)
|
binding.basalpctfromtdd.setParams(32.0, 32.0, 37.0, 1.0, DecimalFormat("0"), false, null)
|
||||||
|
|
||||||
binding.tdds.text = tddCalculator.stats()
|
binding.tdds.text = getString(R.string.tdd) + ": " + rh.gs(R.string.calculation_in_progress);
|
||||||
|
Thread {
|
||||||
|
val tdds = tddCalculator.stats()
|
||||||
|
runOnUiThread { binding.tdds.text = tdds }
|
||||||
|
}.start()
|
||||||
|
|
||||||
// Current profile
|
// Current profile
|
||||||
binding.currentProfileText.text = profileFunction.getProfileName()
|
binding.currentProfileText.text = profileFunction.getProfileName()
|
||||||
|
|
Loading…
Reference in a new issue