Skip to content

Instantly share code, notes, and snippets.

@NewtronLabs
Created June 28, 2020 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NewtronLabs/0eecd78cd513c32a88cdd0682b68f70e to your computer and use it in GitHub Desktop.
Save NewtronLabs/0eecd78cd513c32a88cdd0682b68f70e to your computer and use it in GitHub Desktop.
IpcEventBus-conclusion.java
public class EventExample extends EventIpcSimple {
private IData mData;
public EventExample(IData data) {
mData = data;
}
EventExample(Parcel in) {
readFromParcel(in);
}
@Override
public void readFromParcel(Parcel parcel) {
// Must be done for every object in the event.
mData = (IData) ParcelHelper.getInstance().createFromParcel(parcel, IData.class);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
// Must be done for every object in the event.
ParcelHelper.getInstance().writeToParcel(dest, flags, mData);
}
public IData getData() {
return mData;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment