Search code examples
rx-androidrxandroidble

Problems with serializing RxAndroidBle classes


My app attempts to pass a fairly complex object that uses RxAndroidBle classes from one Android activity to another by adding it to an Intent as a Serializable extra. But I'm getting crashes, apparently due to problems with serialization of these classes.

Is there any fix for this?


Solution

  • Unfortunately it is not possible to serialize classes of RxAndroidBle because most of them contain references to objects that are not serializable.

    If you cannot pass a reference to an object that you want to use in a different part of the code (for instance in a different process) then you would need to create a new instance of RxBleClient in that process and use it.