開発の公式サポート⾔語の1 つになることが発表された • Professional Android developers の 50% 以上が Kotlin を使っている (Google I/O 2019 より) • If you're starting a new project, you should write it in Kotlin; https://android-developers.googleblog.com/2019/05/google-io-2019- empowering-developers-to-build-experiences-on-Android-Play.html
static final android.os.Parcelable.Creator CREATOR = new User.Creator(); ... public void writeToParcel(@NotNull Parcel parcel, int flags) { Intrinsics.checkParameterIsNotNull(parcel, "parcel"); parcel.writeString(this.name); parcel.writeInt(this.age); } ... public static class Creator implements android.os.Parcelable.Creator { @NotNull public final Object[] newArray(int size) { return new User[size]; } @NotNull public final Object createFromParcel(@NotNull Parcel in) { Intrinsics.checkParameterIsNotNull(in, "in"); return new User(in.readString(), in.readInt()); } } }