Search code examples
androidparcelableserializable

How to pass an object to another activity? If the object already implements an interface (so it can't implement Parcelable)?


I'm trying to pass an Object from one activity to another and I know I should use Parcelable or Serializable but my Object class implements an interface already. Is there any way around this?


Solution

  • Objects can implement multiple interfaces:

    class MyClass implements Interface1, Parcelable {
      // Implement each interface
    }