Reputation: 543
I'm trying to Subscribe and Post from the same fragment, but I'm getting this error when i try to register the fragment:
...(my method) has @Produce annotation but requires 1 arguments. Methods must require zero arguments.
on
BusProvider.getInstance().register(this);
So i guess it's not possible, but maybe there is an alternative without additional interfaces.
Thanks in advance!
Upvotes: 1
Views: 1173
Reputation: 152807
Methods annotated with @Produce
must not take any arguments. They should just return the event object.
"I'm trying to Subscribe and Post" suggests you probably need to change it to @Subscribe
annotation instead.
For posting events, just use post()
. @Produce
is meant for returning the latest value of an event.
Upvotes: 4