I want to create Calculator Application, and I just want to make Equal function with exp4j that will calculate string of characters, but I have problem with this.
I don't know exp4j too much and I just don't what to changa, or add to work propertly.
bEqual.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
calculations = input.getText().toString();
try {
Expression expression = new ExpressionBuilder(calculations).build();
double result = expression.evaluate();
output.setText((int) result);
}catch (Exception e){
System.out.println("Message: "+e.getMessage());
}
}
});
E/example.fizcal: Invalid ID 0x0000000e.
I/System.out: Message: String resource ID #0xe
E/example.fizcal: Invalid ID 0x00000009.
I/System.out: Message: String resource ID #0x9
E/example.fizcal: Invalid ID 0x00000291.
I/System.out: Message: String resource ID #0x291
E/example.fizcal: Invalid ID 0x00000291.
I/System.out: Message: String resource ID #0x291
E/example.fizcal: Invalid ID 0x00000291.
I/System.out: Message: String resource ID #0x291
E/example.fizcal: Invalid ID 0x00000291.
I/System.out: Message: String resource ID #0x291
E/example.fizcal: Invalid ID 0x00000291.
I/System.out: Message: String resource ID #0x291
User contributions licensed under CC BY-SA 3.0