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

What is the correct way of creating a parcelable?

I have created the following parcelable object: public class ViewModel implements Parcelable { private String image, price, credit, title, description, id; public ViewModel(String image, String price, String credit, String title, String…
Filip Luchianenco
  • 6,912
  • 9
  • 41
  • 63
0
votes
2 answers

Android Parcelable usage

I have a class with the following structure: class Example { Integer age; String name; Collectionexamples; class Example2 { Integer number; Collectionstrings; } } How can I make this class…
user966123
  • 631
  • 1
  • 9
  • 18
0
votes
0 answers

Android Parcelable vs static class

I was having a discussion with another developer and the argument arose that a static class is better then using parcelable when passing data between activities. When i check on this site the recommendation seems to be that parcelable is faster…
j2emanue
  • 60,549
  • 65
  • 286
  • 456
0
votes
1 answer

Issue in Parcelable implementation in Android Studio 1.2.2 Upgrade

My Parcelable Class : public class Category implements Parcelable{ int id; String name; Department department; @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel…
0
votes
1 answer

Error with unpacking a Custom Data Type from a Parcel in Android

I have this problem of recreating an array of a custom data type after it was written to a parcel. playerwear is declared as such: private Wearable playerWear[] = new Wearable[5]; This is the lines that write it to a parcel in the parent class. It…
baron159
  • 32
  • 8
0
votes
2 answers

BadParcelableException

I am trying to parcel some data from the main activity to another activity and present the data in a ListView. I have a single button in my MainActivity which creates and intent and ships the data to the other activity. However, as soon as I press…
Georgi Koemdzhiev
  • 11,421
  • 18
  • 62
  • 126
0
votes
1 answer

Android, pass a parcelable array or fetch data again from Content Provider?

Bit of a performance question. I have a fragment that fetched some data from the content provider and built an object which implements Parcelable. MyObject object; In the scenario where such objects is required in another fragment, what would be…
0
votes
1 answer

Create object of class that implements Parcelable

How do you actually create an object of a class that implements Parcelable? There are lots of examples online that shows exactly what the class should look like, but I can't seem to find something on how to create the object. If I have a class that…
Code Vader
  • 739
  • 3
  • 9
  • 26
0
votes
1 answer

Unable to send large Array of parcelable objects in another actvity

I have two activity the first activity say Activity1 just gets data from a server filters it and saves it in an arraylist of parcelable objects while displaying a loading screen. After that, Activity1 passes the data it gathered to Acitivty2 which…
ErenRavenHeart
  • 281
  • 3
  • 6
  • 15
0
votes
1 answer

Parcelable:Class not found when unmarshalling error, on Rotation of my fragments

I have a Fragment activity that conatains 2 fragments, the fragment activity passes an arraylist of my classes to its 2 fragments. The 2 fragments Successfully receive the parcellable arraylist on start up, however when I rotate my app, the…
ErenRavenHeart
  • 281
  • 3
  • 6
  • 15
0
votes
1 answer

How do parcelable in Android know which variable to read in its constructor?

You can see from the code below, parcel don't read any key for return the value. How do they know what to read and put into variable someString1 or someString2 and so on? public SomeObject(Parcel in) { this.someString1 = in.readString(); …
stackex
  • 3,205
  • 1
  • 11
  • 16
0
votes
5 answers

Kotlin: assignable "it"?

I'm trying to simplify Parcelable code in Kotlin: public class C() : Parcelable { var b1: Boolean = false var b2: Boolean = false var b3: Boolean = false var i1: Int = 0 var i2: Int = 0 val parcelBooleans = listOf(b1, b2,…
Geob-o-matic
  • 5,940
  • 4
  • 35
  • 41
0
votes
0 answers

Bad parceable Exception

I always get bad parceable exception on my custom entity. I have follow all rules but not getting where the problem is. Below is my class: public class SubChannelsEntity implements Parcelable{ public SubChannelsEntity() { // TODO…
Vinay
  • 41
  • 6
0
votes
1 answer

Pass HashMap with Custom Parcelable Arraylist between activities

I am trying to pass the HashMap between between my services and activity. I know how to pass Arraylist with custom objects. But failed to find the solutions for passing hashmap from service. I have service from where I want to send hashMap to my…
user3290805
  • 445
  • 2
  • 10
  • 28
0
votes
3 answers

Android Parcelable: reading and writing

I want to make a custom entity class Parcelable.. I have some fields in it: a String[] and another custom entity object (which is parcelable).. I want to know how to read and write these objects and lists.. public class CustomEntity implements…
Reza Bigdeli
  • 1,142
  • 1
  • 12
  • 25