My ResultReceiver subclass:
private class MyReceiver extends ResultReceiver {
public MyReceiver() {
super(null);
}
@Override
protected void onReceiveResult(int resultCode, Bundle data) {
// yada yada
}
}
Android Studio throws a wobbly about "Missing Parcelable CREATOR field". But you can see that my subclass doesn't any introduce any new members that would need to be packed into the Parcel. Is Android Studio being overly paranoid, or did I really need to implement a CREATOR field?
For now, I'm adding this:
@SuppressLint("ParcelCreator")
and the problem goes away, but I want to make sure I'm not missing something.
Parcelable creators are typed to the specific class that's being serialized, so to be safe and complete, you should have a properly creator for every class that could be parceled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With