Calculation function in android app causes force close, what's wrong here?
<p>I'm currently developing an app, and have run into an issue causing it to force-close on me whenever I try to call this function:</p>

<pre><code>public void calcActRun() {
double calcmass = bodymass * genderValue;

int qty1 = Integer.parseInt(findViewById(R.id.calcItemQty1).toString());

double vol1 = Double.parseDouble(findViewById(R.id.calcItemVol1).toString());

double percent1 = Double.parseDouble(findViewById(R.id.calcItemQty1).toString());

double alcoholTotal = 0;
double alcoholConcentration = alcoholTotal /calcmass;

int time = Integer.parseInt(findViewById(R.id.calcInputTime).toString());

double alcoholCurrentConcentration = alcoholConcentration - (0.15 * time);
}
}
</code></pre>

<p>I have defined all variables (except the ones defined inside this function) earlier in the code, and eclipse isn't giving me any hints as to why it crashes...</p>

<p>The goal is to input the various values in a form (as you may already have guessed from the code) and get the calculated output when a button in the UI is clicked.</p>

<p>I even tried calling it using a "man in the middle", with the same result (code displayed below)</p>

<pre><code>public void calcButtonClicked(View v) {
 calcActRun();
}
</code></pre>

<p>I know the button itself is working, as everything went ok when I replaced the contents with this:</p>

<pre><code>Toast.makeText(this, "test", Toast.LENGTH_SHORT).show();
</code></pre>

<p>I would be really grateful if anyone could help me demystify this problem - also if you need more info just ask... :)</p>
