Using exp4j which is a mathematical parser twice in one routine (or separated) in Eclipse and only the size2 is calculated when app is run in eclipse. Can someone tell me why? Thanks.
private void calculate size(){
String s1 = size.getText().toString();
String s2 = size2.getText().toString();
try {
Calculable result= new ExpressionBuilder(s1).build();
size1.setText(Double.toString(result.calculate())) ;
} catch (UnparsableExpressionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch(UnknownFunctionException ex) {
ex.printStackTrace();
}
try {
Calculable result= new ExpressionBuilder(s2).build();
size2.setText(Double.toString(result.calculate())) ;
} catch (UnparsableExpressionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch(UnknownFunctionException ex) {
ex.printStackTrace();
}
}