private static final boolean BENCHMARK_TEMPERATURE_CONVERSION = true;

        @Override
        public void onTextChanged(CharSequence input, int start, int before, int count) {
            if (!destinationEditNumber.hasWindowFocus()
                    || destinationEditNumber.hasFocus() || input == null) {
                return;
            }

            String str = input.toString();
            if ("".equals(str)) {
                destinationEditNumber.setText("");
                return;
            }

            long t0;
            if (BENCHMARK_TEMPERATURE_CONVERSION) {
                t0 = System.currentTimeMillis();
            }

            try {
                double temp = Double.parseDouble(str);
                double result = (option == Option.C2F)
                        ? TemperatureConverter.celsiusToFahrenheit(temp)
                        : TemperatureConverter.fahrenheitToCelsius(temp);
                String resultString = String.format("%.2f", result);
                destinationEditNumber.setNumber(result);
                destinationEditNumber.setSelection(resultString.length());
            } catch (NumberFormatException ignore) {
                // WARNING this is generated whilst numbers are being entered,
                // for example just a '-'
                // so we don't want to show the error just yet
            } catch (Exception e) {
                sourceEditNumber.setError("ERROR: " + e.getLocalizedMessage());
            }

            if (BENCHMARK_TEMPERATURE_CONVERSION) {
                long t = System.currentTimeMillis() - t0;
                Log.v(TAG, "TemperatureConversion took " + t
                        + " ms to complete.");
            }
        }