Android program stops working after a few uses
<p>I made my first Android Java program, conversion between celsius and fahrenheit. This works good at first, but after a few conversions it won't convert them. If I change the values and press the button, it won't update the fields. </p>

<p>Here's the code.</p>

<pre><code>package fi.peltoset.mikko.celfahr;

import java.text.DecimalFormat;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Celfahr extends Activity {
  private double celsius = 0.0;
  private double fahrenheit = 0.0;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Button celsiusasteiksi = (Button) findViewById(R.id.celsiusasteiksi);
    Button fahrenheiteiksi = (Button) findViewById(R.id.fahrenheitasteiksi);

    celsiusasteiksi.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
          fahrenheit = Double.parseDouble(((EditText)
                    findViewById(R.id.fahrenheitkentta)).getText().toString());         
          ((EditText) findViewById(R.id.celciuskentta)).setText(
                   String.valueOf(pyorista((fahrenheit - 32) / 1.8)));
        }
     });

     fahrenheiteiksi.setOnClickListener(new View.OnClickListener() {
         public void onClick(View v) {
           celsius = Double.parseDouble(((EditText) findViewById(R.id.celciuskentta))  
                    .getText().toString());     
           ((EditText) findViewById(R.id.fahrenheitkentta))
                    .setText(String.valueOf(pyorista(celsius * 1.8 + 32)));
         }
    });
  }    

  double pyorista(double d) {
    DecimalFormat df = new DecimalFormat("#.#");
    return Double.valueOf(df.format(d));
  }
}
</code></pre>

<p>Sorry about bad language there (Finnish, heh...). </p>
