How to use ScriptEngineManager in Android?
问题 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