Search in sources :

Example 1 with CalcEngine

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);
}
Also used : CalcEngineImpl(com.sfeir.calc.CalcEngineImpl) Intent(android.content.Intent) TextView(android.widget.TextView) CalcEngine(com.sfeir.calc.CalcEngine)

Aggregations

Intent (android.content.Intent)1 TextView (android.widget.TextView)1 CalcEngine (com.sfeir.calc.CalcEngine)1 CalcEngineImpl (com.sfeir.calc.CalcEngineImpl)1