android - No subscribers registered for event class error - Greenrobot -
i getting warning , code written in event subscriber not triggered always.. random.
can me this. thanks.
i have class posts event...
eventlistadapter
:
protected void updatedbtohandle(context context, cursor cursor) { //something here.... toggleevent.setcontext(context); eventbus.getdefault().post(toggleevent); } protected void updatedbtoignore(context context, cursor cursor) { //something here.... toggleevent.setcontext(context); eventbus.getdefault().post(toggleevent); }
event class
:
public class toggleevent { private string name; private context context; public string getname() { return name; } public void setname(string name) { this.name = name; } public context getcontext() { return context; } public void setcontext(context context) { this.context = context; } }
and the subscriber
:
public class toggleeventlistener { public toggleeventlistener() { super(); eventbus.getdefault().register(this); } public void onevent(toggleevent toggleevent) { log.d("toggleevent", "toggle event triggered in event bus"); context context = toggleevent.getcontext(); intent intentforringer = new intent(context, ringertoggler.class); system.out.println("change in calendar here "); //calread.geteventcontrol(context); intentforringer.putextra("start_time", false); intentforringer.putextra("rescan", false); intentforringer.putextra("change", true); intentforringer.setflags(intent.flag_activity_new_task); context.startservice(intentforringer); eventbus.getdefault().unregister(this); } }
not sure why warning...
, code written inside toggle event not executed everytime..
getting missed , random event invoked...
Comments
Post a Comment