I am doing some calculation but unable to parse a string into int or even in float.I searched for solution and i read it somewhere there must be a empty string but i checked my
put these lines inside onClick()
final String height = e1.getText().toString();
final int a = Integer.parseInt(height);
You are fetching value of e1
in onCreate()
, while you want it when user click on button
Also need to check whether height is having any value or not, check Stuluske's answer for this