darkwispr
Newbie
Hello Android Devs,
I'm making an app (my first app that does something) that calculates some electric basic things, thing is when I press the button it force closes the app.
(I made some code that has some Java math things and have not imported anything that has to do with calculation. I've tried putting it in the main activity, putting it in the Activity its running, changing some of the code below, still doesn't work.)
I don't know if some of the stuff above is impossible, I'm not asking for the code, asking for the correct way to do it.
I'm making an app (my first app that does something) that calculates some electric basic things, thing is when I press the button it force closes the app.
(I made some code that has some Java math things and have not imported anything that has to do with calculation. I've tried putting it in the main activity, putting it in the Activity its running, changing some of the code below, still doesn't work.)
Code:
public void getResult (View v){
int orbit, result;
String putresult;
orbit = Integer.parseInt(findViewById(R.id.number).toString());
result = 2*orbit^2;
putresult = String.valueOf(result);
EditText et = (EditText) findViewById(R.id.atom_result);
et.setText(putresult);
}