Questions tagged [parcelable]

parcelable refers to the capability of an object to be converted to a parcel, a container for reading and writing data of various type, using type specific rather than generic serialization

parcelable is defined in the Android API as as interface for classes whose instances can be written to and restored from a parcel

References

1664 questions
0
votes
1 answer

Why @Parcelize annotation requeres to implement abstract methods?

I am trying to get an advantage of auto-generated Parceable like (eg:) described here - https://stackoverflow.com/a/63906355/5709159 or https://medium.com/@BladeCoder/a-study-of-the-parcelize-feature-from-kotlin-android-extensions-59a5adcd5909 As…
Sirop4ik
  • 4,543
  • 2
  • 54
  • 121
0
votes
1 answer

Unresolved supertypes: kotlinx.parcelize.Parceler

I'm trying to migrate from kotlinx.android.parcel.Parcelize to kotlinx.parcelize.Parcelize but I'm getting following issue while doing so: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in…
David
  • 3,971
  • 1
  • 26
  • 65
0
votes
0 answers

How to save the tree structure of classes in SharedPreferences

I've tried using Json, kotlin serialization, Parcelable, but nothing works. The code of my class looks like this: data class Item( var name: String, var children: MutableList = mutableListOf(), var parent: Item? = null ) The…
Murlodin
  • 1
  • 1
0
votes
0 answers

Passing a Room entity as Parcelable

I have an entity class User . I read the posts here and here suggesting that passing ArrayLists of this entity class between intents is a bad idea. However, if I had a class UserCohort with the following data members: public class UserCohort { …
Sriram
  • 10,298
  • 21
  • 83
  • 136
0
votes
1 answer

Issue while parsing a list of objects retrieved from Firebase Firestore collection

I am working on an android project and I've been trying to use Firebase Firestore collections. Everything seems fine up until the second activity retrieving the intent with the parsed list of watches. public class MainActivity extends…
0
votes
1 answer

Why DeadObjectException during AIDL call using byte[] but not Bitmap?

Let's say there are two processes. I am interested in making an AIDL call (e.g. byte[] getBytes()) from an Activity (Process A) to a Service (Process B) which returns a byte[] of data. However when this byte[] of data exceeds 1MB, it triggers the…
code
  • 5,294
  • 16
  • 62
  • 113
0
votes
3 answers

Android getParcelableExtra deprecated in api 33

I want to use intent method for get uri from another activity, but intent.getParcelableExtra is deprecated.if I use if (SDK_INT >= 33) { intent.getParcelableExtra("EXTRA_URI", Uri::class.java).let { ueray -> …
0
votes
0 answers

Navigation parcelavle don't support default value

I’ve got my structure as Activity -> Navigation Fragment Container which has fragments that also contain a Navigation Fragment Container however when I navigate from start destination to localMusicView it works however its child Navigation Fragment…
Aarav Shah
  • 55
  • 1
  • 7
0
votes
0 answers

Android Fragment - RuntimeException: Parcelable encountered IOException writing serializable object

I have this interface: interface MyListener : Serializable { fun onClick() } In my Fragment I have a lazy instance of it which I attach it to the fragment's arguments. Something like: class MyFragment: Fragment() { private val listener:…
0
votes
1 answer

How to add arraylist of header object to Parcelable object?

I must send an Object value to other Activity, so I found the way to using Parcelable Object. but this is the problem. The problem is not parcelable object can not be add Parcelable object. import android.os.Parcel; import…
lupin218
  • 23
  • 1
  • 1
  • 4
0
votes
1 answer

I want to pass date data to another fragment

I want to use DateDialogFragment and put the date I get there to another fragment How do I put the set date after getting the calendar instance? class DateDialogFragment : DialogFragment(), DatePickerDialog.OnDateSetListener { private val…
wish
  • 13
  • 3
0
votes
1 answer

Android: can you pass a custom object using Parcelable and then change its contents?

if i were to pass a custom object to another activity/service using Parcelable using ObjectA obj = new ObjectA(); // Set values etc. Intent i = new Intent(this, MyActivity.class); i.putExtra("com.package.ObjectA", obj); …
0
votes
2 answers

How to use Parcelize Annotation in Android Kotlin?

I am following https://developer.android.com/jetpack/compose/state#parcelize to make a Parcelable data class with Kotlin in Jetpack Compose, however the @Parcelize annotation is not available to be imported. I can add the block below to my code, and…
stan372
  • 5
  • 2
  • 2
0
votes
0 answers

What is the difference between Parcelable and Serializable in Android and which one is the preferred way to pass data?

I've been using Serializable for a while now in Android to pass data between 2 Activities. However, I recently read about Parcelable. Do they work in the same way and which is the best/efficient way to pass data/custom Objects between…
Amey079
  • 131
  • 7
0
votes
0 answers

Property would not be serialized into a Parcel warning after removing KAE

I'm removing KAE plugin to replace with kotlin-parcelize and i expect there is no change in behavior at all. But after that, i got warning on one of parcelable class. Here is my class. @Parcelize class SomeParcelableClass( var foo: String ) :…
wiryadev
  • 1,089
  • 1
  • 11
  • 33