Bind and Unbind custom everyone events with everyone arguments method in everywhere
<dependency>
<groupId>xyz.windjs.android</groupId>
<artifactId>WindHotspot</artifactId>
<version>0.0.1</version>
<type>pom</type>
</dependency>
repositories {
jcenter()
}
dependencies {
compile 'xyz.windjs.android:WindHotspot:0.0.1'
}
WindHotspot.init(); // Use it from onCreate Application or Activity only one
Call call = new Call() {
@Override
public void run(Object... objectes) {
if(objectes.length > 1) Log.d("OK Event", (String) objectes[0]); //String object follow with object u call event
}
};
WindHotspot.getInstance().bind("TestEvent", call);
class YourClass implements Call{
public YourClass(){
WindHotspot.getInstance().bind("TestEvent", this);
}
@Override
public void run(Object... objectes) {
Log.e("FUCK", (String) objectes[0]);
}
}
WindHotspot.getInstance().unbind("TestEvent", call);
WindHotspot.getInstance().call("TestEvent", "Rest", 123, object);