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
2 answers

Pass MatrixCursor of data from Activity to Fragment

The core of this question is how to send a MatrixCursor of data from an activity to a fragment. I am doing my search functionality in my activity and am returning a fragment which contains a list that will be filled with data from the query response…
NVA
  • 1,662
  • 5
  • 17
  • 24
0
votes
1 answer

Best practice for making third-party class parcelable?

I am using a push notification third-party solution (specifically RichPushMessage class from Urban Airship push notification lib). I have created a bundle to be passed about that contains a RichPushMessage field. I need it to implement Parcelable. I…
RMcGuigan
  • 1,147
  • 2
  • 7
  • 11
0
votes
1 answer

How to implement parcelable with my custom class containing Hashmap and SparseArray?

I need to implement parcelable in my custom class "ArtistInfo" with the following structure: public class ArtistInfo implements Parcelable { private String artist; // album name to list of ids of songs private HashMap>…
tom
  • 172
  • 1
  • 10
0
votes
3 answers

Parcelable object passing from android activity to fragment

I'm trying to pass an object that implements Parcelable from an activity to a fragment. I know how to pass from activity to activity. I just want to try this. But when I received the object it always receivednull. How can I resolve this…
Argus Waikhom
  • 186
  • 6
  • 14
0
votes
1 answer

Measuring performance with parcelable

Currently, I am having around 100 Pojo's which implements serializable and passed throughout the app, Since I am expecting more to come as the app grows & it will be better to make use of parcelable. Will there be any significant performance gain…
farhan patel
  • 1,490
  • 2
  • 19
  • 30
0
votes
1 answer

Kotlinx Parcelize class extend

I have two open classes BaseNfcCard and SomeObjectNfcCard. Here SomeObjectNfcCard extends BaseNfcCard and Parcelable, also BaseNfcCard extends Parcelable. When I pass SomeObjectNfcCard to another activity, I have data only from it and not from…
Anton A.
  • 1,718
  • 15
  • 37
0
votes
2 answers

IO Exception writing serializable object? passing images arraylist

class Selected_img_layout: Intent i = new Intent(Selected_img_layout.this, ImagSlider.class); Bundle bundle = new Bundle(); bundle.putSerializable("image_data", spacecrafts); i.putExtras(bundle); …
0
votes
1 answer

How to make RealmList Parcelable?

@Parcelize open class TestClass( @SerialName("title") var title: String, @SerialName("list") var list: RealmList ) : RealmObject() { ... } How can I parcelize "list" variable in this…
MaaAn13
  • 264
  • 5
  • 24
  • 54
0
votes
0 answers

Android Parcelable - How to pass array of custom objects inside another array of custom objects

Let's say I have an orders array. Now, suppose inside each order I have a sellers array. By making the Order class parcelable, it is not working the array of Sellers out. I tried doing this: class Order() : Parcelable { [...] …
rgoncalv
  • 5,825
  • 6
  • 34
  • 61
0
votes
1 answer

Send object from Activity to Fragment using Bundle

I have 2 objects (myProfile and employee) in my Activity and i want to send it to my Fragment. I used bundle, example from stackoverflow, but it is giving me errors. I have follow this stackoverflow example below, but failed. Most examples in…
0
votes
1 answer

Parcelable Implementation for Custom Objects

I have 3 POJO types: a Recipe, which contains ingredients, and then the ingredients contain steps. Below is my setup, I am trying to implement Parcelable and cannot determine the appropriate read and write methods: Recipe.Java: public class Recipe…
tccpg288
  • 3,242
  • 5
  • 35
  • 80
0
votes
0 answers

How to send object to Service in android

I want to send YouTubePlayer object to my Service via intent. Here is code how I send YouTubePlayer object to my service, but it gives error. How can I solve it ? Please help. java.lang.ClassCastException:…
user10065900
0
votes
1 answer

Problems with parcelable custom object - Android

I am trying to pass a custom object from one activity to another one. I found that we can use a bundle to pass data into the intent and that we need a parcelable interface implemented in our class. In the following code I removed the useless…
user10113273
0
votes
0 answers

Android MotionEvent.CREATOR.createFromParcel fails with "Failed to read MotionEvent parcel."

I am trying to read Events from a Parcel. Works for KeyEvents, but for MotionEvents it is giving me an Exception. I dumped the data in the Parcel and looked at the Android Source in Input.cpp, but I still don't understand what's going wrong. Any…
kahlk
  • 156
  • 1
  • 6
0
votes
3 answers

How to pass objects from activity to fragments?

I would like to pass objects (that I got through Retrofit) to fragments. I heard of 2 methods, but I have problems with both. I am trying to pass a FullForecast object to my fragments. Use Parcelize. I implemented it on my class, but it conflicted…
Zolly
  • 317
  • 2
  • 15