Questions tagged [parcel]

In Android, a Parcel is a container for a message (data and object references). It's a high-performance alternative to Java's standard serialization.

This should not be confused with That Parcel is an application bundler for HTML, CSS, and Js

537 questions
13
votes
2 answers

How to parcel List with kotlin

I want to pass a data class (that contains list of int as a property) to other activity through Bundle and therefore i need to add Parcelable implementation to my data class. any idea about how to parcel this property? data class Test(val id: Long,…
Mohammad Zare
  • 1,489
  • 7
  • 25
  • 45
12
votes
2 answers

Writing Objects members to Parcels

So far I've been chugging along with Parcelable objects without issue, mainly because all of their members have been types that have writeX() methods associated with them. For example, I do: public String name; private Foo(final Parcel in) { …
tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
11
votes
3 answers

Write in parcer nullable value in kotlin

Backend returns nullable Int? How should I write nullable value? date class Foo (var value: Int?){ constructor(source: Parcel) : this( source.readInt() ) override fun writeToParcel(dest: Parcel, flags: Int) { …
Yvgen
  • 2,036
  • 2
  • 23
  • 27
11
votes
0 answers

android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.facebook.flatbuffers.helpers.FlatBufferModelHelper$LazyHolder

I'm seeing this crash in Crashlytics for an app that's currently in production: Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.facebook.flatbuffers.helpers.FlatBufferModelHelper$LazyHolder at…
Charles Madere
  • 6,642
  • 5
  • 35
  • 34
11
votes
2 answers

How to use writeStringArray() and readStringArray() in a Parcel

I recently came across a very stupid (at least from my point of view) implementation inside Androids Parcel class. Suppose I have a simple class like this class Foo implements Parcelable{ private String[] bars; //other members public…
Rafael T
  • 15,401
  • 15
  • 83
  • 144
10
votes
3 answers

What is the .cache folder in parcel-bundler? Is it necessary to push the .cache folder to Github?

What is the .cache folder in parcel-bundler? Is it necessary to push the .cache folder to Github ?
Llawliet
  • 123
  • 1
  • 2
  • 8
10
votes
1 answer

Typescript - How can I import png files into my typescript file?

I put up my own typescript project with the Parcel compiler and got everything running on the built-in server. I implemented pixi.js and wanted to import .png files into my .ts files. But when I try to import it says it can't find the module, even…
anonymous-dev
  • 2,897
  • 9
  • 48
  • 112
10
votes
3 answers

Parcelable, what is newArray for?

I am implementing Parcelable in order to transmit some simple data throughout an Intent. However, There is one method in the Parcelable interface that I don't understand at all : newArray(). It does not have any relevant documentation & is not even…
Teovald
  • 4,369
  • 4
  • 26
  • 45
10
votes
2 answers

NullPointerException (etc) from Parcel.readException

Exceptions that look like this are confusing: FATAL EXCEPTION: main java.lang.NullPointerException at android.os.Parcel.readException(Parcel.java:1437) at android.os.Parcel.readException(Parcel.java:1385) at…
benkc
  • 3,292
  • 1
  • 28
  • 37
10
votes
5 answers

Passing custom parcelable object extra or in ArrayList to RemoteViewsService breaks appwidget

Basically what i want to do, is to pass a custom parcelable object via an intent, to the RemoteViewsService and thus to my RemoteViewsFactory. For some reason, this simply doesnt work :S Whenever i attempt to do this, the widget ends up displaying…
Chris6647
  • 178
  • 1
  • 2
  • 13
9
votes
3 answers

Kotlin android parcelable

I've used auto generated feature of android plugin for android studio and it generated me the following code, but I can't understand why is there need for final val for CREATOR field ? I see final keyword for the first time in kotlin. data class…
ashur
  • 4,177
  • 14
  • 53
  • 85
9
votes
2 answers

How to get parcel or zipcode boundaries for display in map?

I want to add a boundary to a specified parcel of land so that it stands out in the map with a colored outline/border. In google maps, this is done using the polygon functionality if you know that path of coordinates to enter to surround the land…
johntrepreneur
  • 4,514
  • 6
  • 39
  • 52
8
votes
5 answers

How do I include asset files with parcel js?

I have a folder of dynamically loaded asset files I want to include in my parcel output directory. How can I include unreferenced static asset files like .json, .jpeg, .txt, .etc with my parcel build command?
ermish
  • 1,160
  • 2
  • 13
  • 26
8
votes
1 answer

What is Parcel.enforceInterface?

Can anyone tell me what the method enforceInterface in Android's Parcel class does? The developer website does not explain its purpose, and Google doesn't return any helpful hits either. Thanks.
user1118764
  • 9,255
  • 18
  • 61
  • 113
7
votes
2 answers

How to define parcelable of interface type in .aidl file?

I have an .aidl file that defines a single parcelable of an interface type, let's say parcelable MyInterface; Whereby MyInterface is a java interface declared in MyInterface.java that extends the Parcelable interface. The android parcelable…
Landschaft
  • 1,217
  • 1
  • 12
  • 12
1
2
3
35 36