Android - A variable might not have been initialized
<p>Trying to create a BMI Calculator I already declared a variable for weight and height, but still I'm getting an error of "variable "weight" might not have been initialized.</p>

<pre><code>public class MainActivity extends AppCompatActivity {

private EditText eheight, eweight;
private Button computeb;
private TextView output, category;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    eheight = (EditText) findViewById(R.id.eheight);
    eweight = (EditText) findViewById(R.id.eweight);
    output = (TextView) findViewById(R.id.output);
    category = (TextView) findViewById(R.id.category);
    computeb = (Button) findViewById(R.id.computeb);

    computeb.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View v) {

            float weight, height, BMI;

            if (checkInputLength())
                return;
            weight = Float.parseFloat(weight.getText().toString());
            height = Float.parseFloat(height.getText().toString());
            computeBMI(weight, height);

            BMI = weight / (height * height);
        }
    });
}
</code></pre>