title: How to use ScriptEngineManager in Android?
body: <pre><code>import android.widget.Toast;
  import javax.script.ScriptEngine;
  import javax.script.ScriptEngineManager;
  import javax.script.ScriptException;
  
   public void bEqual(View v) throws ScriptException {
  
         ScriptEngineManager mgr = new ScriptEngineManager();
         ScriptEngine engine = mgr.getEngineByName("JavaScript");
          String value = inputText.getText().toString();
          Toast.makeText(this,value,Toast.LENGTH_LONG).show();
          try{
              result = (double)engine.eval(value);
              Toast.makeText(this,String.format("%f",result),Toast.LENGTH_SHORT).show();
          }catch(Exception e){
              Toast.makeText(this,"Exception Raised",Toast.LENGTH_SHORT).show();
          }
  
      }
  </code></pre>
  
  <p>What is wrong in it? App is exiting when perform this action.
  It is not showing any errors but app is closing</p>