As is often the case, writing the code from scratch in Haskell is easier than reusing a library in Java..
Android uses named integers rather than enums, due to some issue with Java enums.. And the switch would only help a bit, the main problem is needing to correctly interpret the associated payload according to the message type. That's what sum types give you, which Java doesn't properly have.
They could be emulated with visitor pattern, if one is masochistic...