I want to change the content of the edittext megapixel to be the product of the width and height text boxes to make a megapixel calculator.
public void calculate()
{
EditText tb_widthpx = (EditText) findViewById(R.id.txtbox_widthpx);
EditText tb_heightpx = (EditText)findViewById(R.id.txtbox_heigthpx);
EditText tb_megapixel = (EditText) findViewById(R.id.txtbox_megapixel);
if (tb_widthpx.getText().toString() != "" && tb_heightpx.getText().toString() !="")
{
int produkt;
int width = Integer.parseInt(tb_widthpx.getText().toString());
int height = Integer.parseInt((tb_heightpx.getText().toString()));
produkt = width * height;
tb_megapixel.setText(String.valueOf(produkt));
}