Closed theshapguy closed 9 years ago
Do you have any class that have "onEvent(ClassThatYouUseParcelerFor object){}" ? Because error states that there are no local subscribers to that event class. However Parcerel might not be possible to combine with Android Wear at all as in classes generated by it there are missing some methods - I had very simple classes so I ended up using manually Parcelable.
But back to your problem, it would be nice to see some code, how you are sending it, what object etc.
Parceler Objec via Parceler
@Parcel
public class ButtonClickEvent {
String test;
public ButtonClickEvent(){
}
public ButtonClickEvent(String test){
this.test = test;
}
public String getName() { return test; }
}
Event Post
@OnClick(R.id.button)
public void test_button(View v){
//Log.d(TAG, "Test Button");
Parcelable wrapped = Parcels.wrap(new ButtonClickEvent("Andy"));
EventBus.getDefault().postLocal(wrapped);
}
Event Receiver
public void onEvent(ButtonClickEvent parcler){
Log.d("Event", "Button Event");
}
Since Parceler is being automatically generated I cannot have a onEvent(ButtonClickEvent$$Parcelable) Any possible get arounds?
Also in your code you have written,
implements Parcelable but I would suggest using Parceler or Auto-Parcel library (or any other).
therefore I used that library, but have some doubts now.
Yeah, I also find that issue later on working on other project with Wear (without that library). And couldn't get it to work with Android Wear, so I move to manual Parcelabling. After all I forgot to update README. Anybody with solution is welcome here at this point.
I ended up using Parcelabler. Works fine till now.
I parceled objects with "Parceler", the infamous parceler library, however, I'm getting
no subscribers registered for event
.Any way possible for them to work together?
There is too much boilerplate code involved in extending Parceler, would be great if they both worked together?
Parceler Library Link