0
invoke
메서드의 인수를 올바르게 사용할 수있는 방법을 알려주십시오.BlackBerry의 Object invoke (Object thiz, Object [] args) 메서드 사용
browserField.extendScriptEngine("interesting.test", new ScriptableFunction() {
public Object invoke(Object thiz, Object[] args) throws Exception {
Dialog.alert("Done");
return super.invoke(thiz, args);
}
});
다음과 같이 HTML 파일에서 위의 메소드를 호출합니다. 나는 다음 코드를 사용하십시오
<button type="button" onclick="interesting.test()">Display Alert</button>
는
System.out.println("# thiz : " + thiz.toString());
결과는
[0.0] # thiz : net.[email protected]a2f32d2a
내가이 코드를 사용할 때
System.out.println("# args : " + args.length);
결과는
입니다[0.0] # args : 0
콘솔에 인쇄됩니다.
나는 System.out 메서드를 invoke 메서드 내에서 사용했습니다. 또한 API 문서를 참조했지만 여전히 두 인수에 값을 전달하고 검색하는 방법을 이해할 수 없었습니다. 당신이 시도 할 수