use of com.sfeir.calc.CalcEngine in project jhybrid by Sfeir.
the class DisplayResultActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
String expr = intent.getStringExtra(MainActivity.EXPR);
/**
* Call the core library
*/
CalcEngine calcEngine = new CalcEngineImpl();
int evaluate = calcEngine.evaluate(expr);
// Create the text view
TextView textView = new TextView(this);
textView.setTextSize(40);
textView.setText("" + evaluate);
setContentView(textView);
}
Aggregations