我在Rhino Android中收到有关Proguard问题的NullPointerException

时间:2019-05-05 09:15:57

标签: android javax.script

我的代码如下:

 compile 'io.apisense:rhino-android:1.0' 


    TextView resultTextView = findViewById(R.id.result_text_view);
    String currentText = resultTextView.getText().toString();
    boolean valid = checkForValidity();
    double result=0;
    if(valid){
        ScriptEngine engine = new 
        ScriptEngineManager().getEngineByName("rhino");
        try{
            result = (double)engine.eval(currentText);
        }catch(Exception e){
             Toast.makeText(this,"Exception 
              Raised",Toast.LENGTH_SHORT).show();
        }
        currentText = currentText +"\n"+ "="+(result);
    }
    resultTextView.setText(currentText);

0 个答案:

没有答案