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

In kotlin, how to recieve data class in bundle with parcelable?

Send bundle from itemClickListener of Recyclerview in Activity like this val bundle = Bundle() bundle.putParcelableArrayList("myPlace", ArrayList(myPlace)) ScheduleListFragment().arguments = bundle …
0
votes
1 answer

why it is throw error as NullPointerException when I using Parcelable for my project in Kotlin?

I have small chat app and I try to use the Parcelable for my project, there is not any error until debug the project. When I debug the project it is throw an error for setInfo(chat) return participants.find { it.id != userId }!!.profilePicture as…
user10991969
0
votes
1 answer

Android using tasker to send parcelable bundle in intent

I'm finding it hard in using tasker to send an intent which must contain a parcelable bundle. I have found a lot of examples in java codes, but to have it done in tasker appears to be quite complicated. Has anyone tried this and could share some…
dohanin
  • 11
  • 6
0
votes
1 answer

How to read List> using Parcelable in Android

While retrieving information in GET, I get proper response. Now, I am trying to send some data back to Server using Post call. But when I do it, I get classCastException Here is model class public class Polygon implements Parcelable { …
Roon13
  • 387
  • 2
  • 23
0
votes
1 answer

Why am i getting a ClassNotFoundException when reading from a parcelablearray?

First time asking something. Right now im trying to send a HashSet to another activity. So what i did is this: I made Item parcelable. Its just a class containing a string so the methods to pack and unpack the parcel are not included. I made…
0
votes
0 answers

How to add a parameter to a Parcelable data class?

I have already a Parcelable data class which is used across the module: @Keep data class TotalProductValue(val header: String?, val prices: Pricing?, val cta: Cta?) : Parcelable { constructor(parcel: Parcel) : this( …
pandey_shubham
  • 423
  • 5
  • 14
0
votes
1 answer

NullPointerException when sending nested ArrayList via Parcelable

I am trying to send a nested ArrayList object via Parcelable intent. Name of custom object is 'ExampleItem' which contains nested custom object 'B'. I am sending from MainActivity to Activity2. I get NullPointerException error "Attempt to invoke…
mars8
  • 770
  • 1
  • 11
  • 25
0
votes
1 answer

Using both Parcelable class and Serializable in one class

I have class Data with some properties, where one of the property is a class which implements Serializable and another one implements Parcelable, other properties is String. And I want to make this Class (Data) implement Serializable. Is there any…
researcher
  • 1,758
  • 22
  • 25
0
votes
0 answers

Listviewitem is passed by reference rather by value (parceable and serializable)

I've got a simple listView which calls another fragment to update the selected driver: public static ArrayList allDrivers = new ArrayList<>(); //statict just so i can checj if the value is automatically changed in the other fragment, which…
0
votes
1 answer

How to pass a list of objects from one activity to another using parcelable

I want to pass the list of itemselected or ItemsInCart to another activity. My Items Model implements parcelable. The problem is am getting error below in my SecondActivity class. Caused by: java.lang.NullPointerException: Attempt to invoke virtual…
creg
  • 13
  • 4
0
votes
1 answer

Attempt to invoke interface method 'int java.util.List.size()' on a null object reference on passing Parcelable in Intent Kotlin

So I have a sample app that is currently using Retrofit to fetch data and display it in a recyclerview with its custom adapter. I want to pass the data to the a more details page when I click on a character name on my recyclerView. I found some…
0
votes
1 answer

Reading and writing java.util.ArrayList from Parcelable class

I'm using Parcelable class to send Object from one activity to another activity in Android Java. Parcelable only implements for me String data. How I can read and write productsArrayList and status from this class? public class Bill implements…
LeeHari
  • 31
  • 7
0
votes
3 answers

App crashing on starting another activity with intent and .putExtra

I am trying to open another activity by intent and putExtra. It used to run fine previously, but now it crashes. startActivity(new Intent(ForgotPassword.this, OtpVerification.class) .putExtra("user", user) …
Ankit Verma
  • 496
  • 5
  • 21
0
votes
1 answer

Passing bundles/intent to another activity?

I'm new to coding. I am trying to pass the movie array and the date to the next Main_Activity3 so that it can be printed on the page. But i don't know how to put the data required into intent. For the movies, i would only need the selected movie to…
0
votes
1 answer

Kotlin AndroidStudio Type Mismatch

I get some error in my code, Type mismatch. Required : FavoriteData, Found : FavoriteData? for the lines dataFavorite = activity!!.intent.getParcelableExtra(EXTRA_NOTE) as FavoriteData and Type mismatch. Required : UserData, Found : UserData? for…