@SuppressLint("SetTextI18n") @Override public void updateUI() { try { CrashReporter.leaveBreadcrumb("Trip_Stock_Load : updateUI"); // Update the UI. infoview.setDefaultTv1("Load product"); // Set the Line product in the title bar infoview.setDefaultTv2(DbUtils.getInfoviewLineProduct(Active.vehicle.getHosereelProduct())); if (product == null) { tvProduct.setText("None"); } else { int stockLevel = 0; if (stockLevels.containsKey(product.Desc)) { stockLevel = stockLevels.get(product.Desc); } int requiredAmount = 0; if (requiredProducts.containsKey(product.Desc)) { requiredAmount = requiredProducts.get(product.Desc); } if (requiredAmount > stockLevel) { int toLoad = requiredAmount - stockLevel; // Load product. tvProduct.setText(String.format(Locale.UK, "%s %d litres", product.Desc, toLoad)); } else { // Load product. tvProduct.setText(String.format(Locale.UK, "%s 0 litres", product.Desc)); } } } catch (Exception e) { CrashReporter.logHandledException(e); } }