I made a simple beanshell ide in android using edittext and button. When the button is pressed, it is called Interpreter.eval()and passed as a parameter edittext.getText().toString(). I want to know: how can I create a method in beanshell and run it?
This is the code I'm trying to execute in my beanshell ide:
import android.widget.Toast
int i=add(1, 5);
Toast.makeText(context, ""+i, 5000).show();
int add(int i, int j){
return i+j;
}
But I get the following error:
Command not found: add ()
source
share