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
6
votes
1 answer

Parcel List of List of Parcelable object

So I've parceled lists before, however I'm trying to parcel my GameBoard object, which actually has a List>. Tile implements parcelable, but I'm not sure exactly how to parcel the List. Here's what I've tried: public class…
Kevin DiTraglia
  • 25,746
  • 19
  • 92
  • 138
6
votes
1 answer

Restoring view SavedState throws ClassNotFoundException when unmarshalling parent view SavedState

I have 2 classes ParentClass and ChildClass: ParentClass is a subclass of RelativeLayout which saves state using onSaveInstanceState() / onRestoreInstanceState() with following code: @Override protected Parcelable onSaveInstanceState() { …
nemezis
  • 536
  • 1
  • 6
  • 21
6
votes
3 answers

Writing arrays of Parcelables to a Parcel in Android

I'm trying to write an array of objects that implement Parcelable into a Parcel using writeParcelableArray. The objects I'm trying to write are defined (as you'd expect) as: public class Arrival implements Parcelable { /* All the right stuff…
Jeremy Logan
  • 47,151
  • 38
  • 123
  • 143
5
votes
3 answers

Putting a Bitmap into a Bundle

I want to pass a String and a Bitmap to a Service using AIDL. The Service implements this AIDL method: void addButton(in Bundle data); In my case, the Bundle contains a String and a Bitmap. The calling application (client) has this code: ... // Add…
rippeltippel
  • 369
  • 1
  • 7
  • 15
5
votes
1 answer

When to call Parcel.recycle()?

I have to work with IBinders and Parcels. I've gone through all of the IBinder, Binder, and Parcel documentation and could not find anything which talks about when to call Parcel.recycle (I also never read anything that said that a parcel must be…
5
votes
3 answers

@parcel/core: Failed to resolve 'process' from './node_modules/@firebase/firestore/dist/index.esm2017.js'

I'm working on a project and when I try to run parcel dev or build command it outputs the following error: × Build failed. @parcel/core: Failed to resolve 'process' from './node_modules/@firebase/firestore/dist/index.esm2017.js' …
Muhammad Mahmoud
  • 621
  • 1
  • 5
  • 21
5
votes
1 answer

Top-level await does not work with Parcel

Top level await works correctly when I run it in live server plugin (or edit live Webstorm IDE); however, that code throws an error when I deploy it with npx parcel index.html. Uncaught SyntaxError: await is only valid in async functions and the…
elmi
  • 166
  • 1
  • 9
5
votes
0 answers

How do I solve error : "@parcel/transformer-postcss: PostCSS config must have plugins"

Building my project with parcel I got this error: @parcel/transformer-postcss: PostCSS config must have plugins at load ([projectpath]/node_modules/@parcel/transformer-postcss/lib/loadConfig.js:166:13) This happened since when I upgraded…
koalaok
  • 5,075
  • 11
  • 47
  • 91
5
votes
1 answer

Android 10 BadParcelableException ClassNotFoundException when unmarshalling using Kotlin @Parcelize

In Firebase, I'm getting various crashes in my production app (uses Dexguard), while using Parcelable. These crashes are now affecting almost 200 users and are grouped into 3 entries on Firebase. In one entry, crashes are only on Samsung devices, in…
Favolas
  • 6,963
  • 29
  • 75
  • 127
5
votes
1 answer

npm install global not working on mac, Says I don't have permissions? Missing write access to /usr/local/lib/node_modules

I don't have permissions to my node modules files, It is not allowing me to install or update anything globally. I know that using -sudo is not recommended for it can cause problems with permissions later. I thought I could update npm and node to…
Mark Wild
  • 213
  • 1
  • 3
  • 13
5
votes
3 answers

SyntaxError: private fields are not currently supported

Problem to enable 3d map of openlayers. 2D map works great. Using parcel and all dependencies are added. Once importing cesium on js file i got SyntaxError: private fields are not currently supported. In package json file added "cesium": "^1.62.0".…
Niru
  • 221
  • 1
  • 4
  • 12
5
votes
4 answers

How to fix `Class constructor LitElement cannot be invoked without 'new'`?

I am setting up a new project using lit-element from polymer and the build setup includes the use of parcel. I am also using typescript to write my code. I started by initializing npm and added all the necessary dependencies: "dependencies": { …
Sudarshan
  • 161
  • 2
  • 11
5
votes
0 answers

writeToParcel() not called in orientation changes in Android

I've an Activity and a Parcelable class that I want to save on orientation changes. Here is the code in the Activity: Keeper keeper = ...; @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); …
MisaMisa
  • 273
  • 3
  • 7
5
votes
4 answers

Android listener serialization

I have CustomDialog class that extends DialogFragment. I override onCreateDialog method, to get custom dialog i wanted. @Override public Dialog onCreateDialog(Bundle savedInstanceState) { dialog = new Dialog(activity, styleId); view =…
4
votes
2 answers

How do I know how big to make my array for Parcel.readStringArray()?

I'm getting a null pointer exception when I do this: private String[] foo; private void readFromParcel(Parcel in) { in.readStringArray(foo); } It seems I need to allocate the array first. But how do I know how big to make it? …
i_am_jorf
  • 53,608
  • 15
  • 131
  • 222