【发布时间】:2014-05-04 14:54:57
【问题描述】:
CLI 版本 3.2.3,Titanium SDK 版本 3.2.2.GA
我正在使用一个外部 jar 文件,并试图让它在原生模块中工作,以便原生模块可以与钛一起使用
我无法从处理程序触发事件
我在本机模块中有两个类 clsModule 和 Handler
clsModule.java
import ext.Extclient;
@Kroll.module(name="extclient", id="ti.extclient")
public class clsModule extends KrollModule{
private Handler h ;
Extclient ext ;
public clsModule()
{
super();
ext = new Extclient();
h = new Handler(this);
im.addHandler(h);
}
}
Handler.java
import ext.ResponseHandler;
public class Handler implements ResponseHandler
{
public void OnConnected(String arg0, String arg1) {
HashMap<String, Object> event = new HashMap<String, Object>();
event.put("u1", arg0);
event.put("u2", arg1);
//How do i fire a event here ?
}
}
我尝试使用 fireEvent,但没有成功,它给出了一个未定义的错误。
【问题讨论】:
-
还在寻找解决方案?
-
你尝试过 Ti.App.fireEvent 吗?
标签: java android titanium titanium-modules