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

How to use parcelable with setters and getters?

I'm using the parcelable implemenation because it's easier to pass an ArrayList with putParcelableArrayListExtra, but what is the purpose of protected Song(Parcel in) and public void writeToParcel(Parcel dest, int flags) My parcelable class public…
Vince VD
  • 1,506
  • 17
  • 38
0
votes
0 answers

How to pass a SimpleExoPlayer instance between two activities?

I am creating a music player like Spotify and was trying to achieve the functionality where the song continues getting played just above the BottomNavigationBar while navigating through the app and even when the activity/fragment which has the…
Neeraj Sewani
  • 3,952
  • 6
  • 38
  • 55
0
votes
1 answer

Sending an array of String and receive it using parcelable kotlin

i been trying to send up an array of string using parcel in kotlin, i tried several things like converting to array before using writeTypedArray, or directly using writeStringArray. I also tried to read using createTypedArray and…
DKVV
  • 23
  • 1
  • 4
0
votes
2 answers

Is it possible to store data from two different parcelable data classes in one single intent to start a new Activitiy with it?

after researching a lot, I wasn't able to find the real solution for my problem. The most answers are based on attaching single parcelable object to an intent and starting a new activity from it. In my case, I use data from two different parcelable…
0
votes
0 answers

String resource field's value in a Parcelable object isn't always accessible through getString()

I'm setting up a RecyclerView using an Adapter class to populate it with objects consisting of a TextView and an ImageView. The string that i want to use as my TextView's text is passed and saved in my Parcelable object , the PlaceObject class as a…
Stelios Papamichail
  • 955
  • 2
  • 19
  • 57
0
votes
1 answer

Read and write Parcel when using ArrayList of ArrayList

I'm trying to read and write this ArrayList structured as well: ArrayList>> points I've seen that the only way would by using the class inside the external ArrayList, but in this case I haven't it. This is my full class,…
Fabio
  • 635
  • 6
  • 17
0
votes
1 answer

Using T in a baseFragment, will result in using that function to need a 'Nothing" instead of Fragment

This is my method: abstract class BaseFragmentKey : Parcelable { fun newFragment(): T { val fragment = createFragment() val bundle = Bundle() bundle.putParcelable("KEY", this) fragment.arguments =…
rosu alin
  • 5,674
  • 11
  • 69
  • 150
0
votes
1 answer

When I send object from fragment to another fragment original data updated

I am using Parcelable when I am sending data between fragments. I send my object class from 'TasksFragment' to 'EditTaskFragment'. My object class is below. public class TaskResult extends BaseObservable implements Parcelable { private int…
Barış Sağlam
  • 61
  • 2
  • 11
0
votes
0 answers

Kotlin annotation @Parcelize reliability

I heard about Kotlin @Parcelize annotation long time ago, but it still was experimental and now it is not, IDE still complains about implementing Parcel members, but it seems to work. Does anyone using it? is it safe? It seems to work, but is it…
Antonis Radz
  • 3,036
  • 1
  • 16
  • 34
0
votes
0 answers

While making POJO parcelable I am getting exception Unexpected character ('<' (code 60))

When I am making parcelable one field I am getting this error Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') I have tried without making parcelable field so I am not…
0
votes
1 answer

Android - android.os.BadParcelableException: ClassNotFoundException when unmarshalling:

I've been working on a assignment that revolves around creating a smaller app for the game Thirty - a variant of Yatzy. Getting some error messages though with my parcelables. The error is according to the stacktrace somewhere in the class…
jb15
  • 1
  • 2
0
votes
1 answer

Variable's value gets lost outside of the constructor in a Parcelable object

The String variable finalMapSearchUrl gets concatenated with another String (mapUrlParam) in the constructor and the Log shows the expected value : Final map URL : https://www.google.com/maps/search/?api=1&query=Spilia%20Beach (here the mapUrlParam…
Stelios Papamichail
  • 955
  • 2
  • 19
  • 57
0
votes
2 answers

Why I'm facing Parcelable issues just when minify is true?

My app is working great on debug build variant, but when I put on release, that the only difference is the obfuscation, the app doesn't work well fun upsertPatient(patient: Patient, onCompletion: (Patient) -> Unit) { val px =…
Shermano
  • 1,100
  • 8
  • 31
0
votes
1 answer

How do I map a JSON object with generic names in a list?

So I've got this JSON format coming my server(names and values have been changed) { "Test.Tester": { "test1": "value", "test2": "value", "test3": 1, "test4": 1000, "test5": true, "test6": [], "test7": { "RAW,1":…
Mikkel Larsen
  • 876
  • 2
  • 14
  • 26
0
votes
1 answer

Passing Parcelable object which has a member variable which is Not parcelable(a class that belongs to third party library)

I'm trying to send a class's object(let's say Class X's object) as part of class that implements Parcelable. The problem that I am facing here is, Class X is a part of some library and I can not edit it to implement Parcelable or serializable. I've…
Alien Geography
  • 383
  • 1
  • 2
  • 14