NullPointerException after changing class ( Code worked before )
<p>I'm doing basic calculator for Android in Java. My calculator worked but i had all code in one class. Then i wanted to make code more readable and i created another Calculation class and i put calculation code in there. And now for some reason my app crashes. LogCat says: NullPointerException. (My app starts fine and then when i choose desirable currency to convert and when i click on ImageButton(convert) then app crashes). Here is my code:</p>

<p>CroToEu class:</p>

<pre><code>package com.eu.calculator;


import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;



public class CroToEur extends Activity {

TextView resultView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.cro_to_eur);

    final ImageButton convert = (ImageButton) findViewById(R.id.converButton);
    convertButton(convert);


}


private void convertButton(final ImageButton convert) {

    resultView = (TextView) findViewById(R.id.resultView);

    convert.setOnTouchListener(new View.OnTouchListener() {



        @Override
        public boolean onTouch(View v, MotionEvent event) {

            Calculate now = new Calculate();
            now.croToEu();


            if(event.getAction() == MotionEvent.ACTION_DOWN) {

                convert.setImageResource(R.drawable.convert_button_ontouch);   

                checkForEmptyEntry();

            } else if (event.getAction() == MotionEvent.ACTION_UP) {

                convert.setImageResource(R.drawable.convert_button);
            }
            return false;
        }



        private void checkForEmptyEntry() {


            if(Calculate.HRKfield.getText() == null || "".equals(Calculate.HRKfield.getText().toString())) {

                resultView.setText("You left empty field");
            } else {

            resultView.setText(Calculate.HRKfield.getText()+" HRK = "+Calculate.fixDecimal+" EUR");

            }
        }
    });
}  
}
</code></pre>

<p>And my calculation class:</p>

<pre><code>package com.eu.calculator;


import java.math.BigDecimal;

import android.app.Activity;
import android.widget.EditText;




public class Calculate extends Activity {


public static EditText HRKfield;    //S tem dobimo vrednost iz polja edittext  
public static double EUR = 0.133;//drži vrednost
public static Double HRK;   // Možnost uporabe double za parsing
public static double result; // rezultat
public static BigDecimal fixDecimal; // rezultat pretvori na decimalko



public BigDecimal croToEu() {

HRKfield = (EditText) findViewById(R.id.enterField);



    try {
        HRK = Double.parseDouble(HRKfield.getText().toString()); //tukaj dobimo čisto številko, ki jo uporabnik vnese v polje
        result = HRK * EUR;
        fixDecimal = new BigDecimal(result);
        fixDecimal = fixDecimal.setScale(2, BigDecimal.ROUND_HALF_UP);

    } catch (NumberFormatException e) {

    }
    return fixDecimal;
}

}
</code></pre>
