[Android] Fix BadParcelableException by using @Parcelize
Nicolas Pomepuy
git at videolan.org
Tue Aug 13 10:17:09 CEST 2019
vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Mon Aug 12 08:56:38 2019 +0200| [c01d26bcf57d947de31c30f599d4ff5f0af61693] | committer: Nicolas Pomepuy
Fix BadParcelableException by using @Parcelize
> https://code.videolan.org/videolan/vlc-android/commit/c01d26bcf57d947de31c30f599d4ff5f0af61693
---
.../org/videolan/vlc/gui/tv/MediaItemDetails.kt | 35 ++--------------------
1 file changed, 3 insertions(+), 32 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetails.kt b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetails.kt
index 20941ce48..8b47848eb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetails.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetails.kt
@@ -22,39 +22,10 @@ package org.videolan.vlc.gui.tv
import android.os.Parcel
import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+ at Parcelize
data class MediaItemDetails(var title: String? = null, var subTitle: String? = null,
var body: String? = null,
var location: String? = null,
- var artworkUrl: String? = null) : Parcelable {
- constructor(parcel: Parcel) : this(
- parcel.readString(),
- parcel.readString(),
- parcel.readString(),
- parcel.readString(),
- parcel.readString())
-
- override fun writeToParcel(parcel: Parcel, flags: Int) {
- parcel.writeString(title)
- parcel.writeString(subTitle)
- parcel.writeString(body)
- parcel.writeString(location)
- parcel.writeString(artworkUrl)
- }
-
- override fun describeContents(): Int {
- return 0
- }
-
- companion object CREATOR : Parcelable.Creator<MediaItemDetails> {
- override fun createFromParcel(parcel: Parcel): MediaItemDetails {
- return MediaItemDetails(parcel)
- }
-
- override fun newArray(size: Int): Array<MediaItemDetails?> {
- return arrayOfNulls(size)
- }
- }
-
-
-}
+ var artworkUrl: String? = null) : Parcelable
More information about the Android
mailing list