1

So, I want to pass a TextView to a Rhino function in Android.

Learned how to call js functions here

The relevant Java:

TextView tv = new TextView(this);
Object result = fct.call(context, scope, scope, new Object[]{tv});

The relevant Javascript:

function doSomething(tv)
{
    tv.setText("Hello");
}

I get an error when calling TextView methods.

In response to @NathanTuggy NoSuchMethod exception... I know for a fact that android TextView has a method setText(String s) method as I have used it many times. I literally copied and pasted the javascript code from my file... From my experience in javascript it should be 100% correctly formatted.

Community
  • 1
  • 1
Jax
  • 402
  • 7
  • 24

0 Answers0