Fix crash in Combo fragment when accessing resoures.

This commit is contained in:
Johannes Mockenhaupt 2017-12-30 19:53:22 +01:00
parent f658da42a7
commit 5ecc0ea430
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -193,7 +193,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
lastConnectionView.setText(R.string.combo_pump_connected_now);
lastConnectionView.setTextColor(Color.WHITE);
} else if (plugin.getPump().lastSuccessfulCmdTime + 30 * 60 * 1000 < System.currentTimeMillis()) {
lastConnectionView.setText(getString(R.string.combo_no_pump_connection, min));
lastConnectionView.setText(MainApp.sResources.getString(R.string.combo_no_pump_connection, min));
lastConnectionView.setTextColor(Color.RED);
} else {
lastConnectionView.setText(minAgo);
@ -206,7 +206,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
long minSinceRead = (System.currentTimeMillis() - plugin.getPump().state.timestamp) / 1000 / 60;
long remaining = ps.tbrRemainingDuration - minSinceRead;
if (remaining >= 0) {
tbrStr = getString(R.string.combo_tbr_remaining, ps.tbrPercent, remaining);
tbrStr = MainApp.sResources.getString(R.string.combo_tbr_remaining, ps.tbrPercent, remaining);
}
}
tempBasalText.setText(tbrStr);