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

How to pass a Parcelable class which contains a list of another parcelable class?

I'm trying to pass a Parcelable class from one Activity to another. I do it like this: Intent intent = new Intent(ClosedChatActivity.this, AdminProfileActivity.class);intent.putExtra("adminProfile", adminProfile); startActivity(intent); And then…
Stasky
  • 107
  • 1
  • 5
0
votes
1 answer

Parcelable object changes completely when sent as an Extra of an Intent

I'm trying to put a Parcelable object as an extra in an intent and pass it to the next Activity, and it doesn't crash but the object changes dramatically. I'm sending when clicking on an item from a RecyclerView in a Fragment and opening an Activity…
Stasky
  • 107
  • 1
  • 5
0
votes
2 answers

Check reified class is Parcelable or Serializable

I have defined an inline method that provides a way to deserialize fragments argument. And I need to check requested Arg type to choose deserialization method. inline fun Fragment.navArgParser( crossinline…
0
votes
1 answer

How to display data in the form of images from the intent process sent using arraylist and parcelable?

class DetailActivity : AppCompatActivity() { companion object { const val EXTRA_USER = "extra_user" } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_detail) …
0
votes
1 answer

Copy parcelable data object

How do I copy the parcelable data object I received through an intent from another package to the local object? Of course so that it includes the fields and their values. Must the parcelable object contain write(dest: Parcel, flags: Int)? I ask…
galaxigirl
  • 2,390
  • 2
  • 20
  • 29
0
votes
2 answers

Android/Kotlin: problems with parcelable

I am having some problems with implementing Parcelable in a class in my app. This is written in Kotlin. I have a class called CocktailRecipe that has what you'd expect - name, description etc. It also has a two lists and a map. Ingredient and…
Donagh
  • 89
  • 2
  • 10
0
votes
1 answer

Parcel: unable to marshal value com.google.firebase.firestore.DocumentReference

I store a list of references in the Cloud Firestore. When I get the data I it gives me this error: "java.lang.RuntimeException: Parcel: unable to marshal value com.google.firebase.firestore.DocumentReference@44bef898" I've searched on the internet…
0
votes
1 answer

How to update recyclerview element and retrieve sum all updated elements

Updating value of recyclerview but unable to update corresponding data in model class Model classes @Parcelize class GetStockListData : ArrayList(), Parcelable @Parcelize data class GetStockListDataItem( var Qty:@RawValue…
sri
  • 73
  • 1
  • 11
0
votes
1 answer

Passing array of coordinate[] to a new activity?

I am trying to pass an array of type Coordinates (coordinate[] arrCoordinates) to another Activity class. I find it easy to pass Strings and Ints (e.g intent.putExtra("string", myString); but I can't seem to pass an array of coordinates. I also…
cptham
  • 23
  • 1
  • 4
0
votes
1 answer

Android Parcelable Issue - ClassNotFoundException when Unmarshalling

I have an object list as follows: data class MyProduct( var id: String?, var name: String? ) : Parcelable { override fun writeToParcel(parcel: Parcel, flags: Int) { parcel.writeString(id) parcel.writeString(name) } …
0
votes
2 answers

pass ArrayList of ArrayList to another class

How to pass the ArrayList of ArrayList , for example I have created one object. For example, I have a class OperationInfo and I need to pass ArrayList> to other class. my OperationInfo class is parcelable. but it seems…
Hunt
  • 8,215
  • 28
  • 116
  • 256
0
votes
1 answer

How to make List parcelable?

I have a variable of List Long type which I want to save using savedInstanceState. So I need to make it Parcelable. How I do it?
tsil
  • 2,069
  • 7
  • 29
  • 43
0
votes
2 answers

how to read Int arraylist in parcelable in android

I am making a data class for Parcelable. but unable to find out a solution that, how to read integer ArrayList in Parcelable class in kotlin. I know about String, but I face a problem in the Int type ArrayList. var priceDetail:…
Shirsh Shukla
  • 5,491
  • 3
  • 31
  • 44
0
votes
0 answers

Sending Arraylists to another results in random strings

I'm trying to send an ArrayLists from MainActivity to SecondActivity. As a result, the ArrayLists should be displayed on ListView. I implemented a code, and instead of showing strings in ArrayLists, the value shows somewhat weird objects such as…
BYcast
  • 1
  • 2
0
votes
1 answer

How can I save an arraylist filled with objects of type person using onSaveInstanceState?

I have this list: private ArrayList people = new ArrayList<>(); And this list is filled with random people. Whenever I turn my screen, the list refreshes and a new list appears. I dont want this to happen. I have tried to do this with the…