square / otto

An enhanced Guava-based event bus with emphasis on Android support.
http://square.github.io/otto/
Apache License 2.0
5.16k stars 847 forks source link

Using privitives in callback haven't invoked it. #191

Open lectricas opened 8 years ago

lectricas commented 8 years ago

So I said: bus.post(228); //int

and then tried to get it inside my Fragment and it haven't worked.

Then I changed it to String and everything became fine.

Is it ok?

gauravsak commented 8 years ago

@lectricas Did you get an exception in the first case? If not, what went wrong?

lectricas commented 8 years ago

@gauravsak no, I haven't got any exceptions. I got just nothing. Maybe it don't know how to work with primitives

pforhan commented 8 years ago

This sort of thing is generally better to ask on StackOverflow.

What was your subscription method like? I'd bet if you used an Integer as a parameter it would have worked -- I don't know if Otto is clever enough to look at unboxing values.