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

How I can convert this Generic Class to a Parcelable?

I want to convert this generic class to a parcelable object, but I don't have very clear the concepts of the issue. Class: public class Type implements Parcelable { // T stands for "Type" private T t; public void set(T t) { this.t =…
Víctor Martín
  • 3,352
  • 7
  • 48
  • 94
0
votes
1 answer

Class Parcelable with ArrayList of Objects

I'm trying to use Parcelable on a class that contains ArrayList of Objects. I'm getting an error when trying to write the list. the class - public class Library implements Parcelable { ArrayList stations; private String[]…
Tsur Yohananov
  • 533
  • 1
  • 7
  • 17
0
votes
4 answers

can i get several intents in the same class using getparcelableextra

could someone please answer my question. in my activity class.java, I have an intent and i want to send an object using intent. when I searched for it, the results were I have to implement parcelable to the class "object" that I want to send it. I…
0
votes
2 answers

The best way to pass array of objects to the activity (or view)?

I was looking for a way to pass array of objects to my activity/fragment. The first thing that came up to my mind was making the object Parcelable and then pass it inside an intent as a list. However, Parcelable concept is mainly designed to be used…
stdout
  • 2,471
  • 2
  • 31
  • 40
0
votes
2 answers

How to pass object with List of other object between activities using Parcelable?

I have an object called Order which I want to pass between activities. Currently I am using Parcelable to do so. public class Order implements Parcelable { private String email; private Long timestamp; private List items; …
Tom Finet
  • 2,056
  • 6
  • 30
  • 54
0
votes
1 answer

Creating and passing object to activity fails

I want to create and pass an object through intent to another activity, so I can process the object details in this activity and show it to the user. This object is being identified by a value long. I have an arraylist (releaseIds) which holds…
Simon
  • 1,691
  • 2
  • 13
  • 28
0
votes
2 answers

Pass songs from Arraylist to another activity

I want to create a very simple app that shows a list of songs and when clicking on song it opens a new Activity to show the playing statue of the song, I almost created it all but when I click on play button it doesn't play. First activity: …
Sally Gomez
  • 554
  • 1
  • 4
  • 9
0
votes
1 answer

Android ResolveInfo Parcelable not completely unparceled

I'm stumbling on what I would have expected to be an easy task, that is writing a ResolveInfo object to a Parcel and then creating a ResolveInfo from this Parcel. Sadly it is not as my code crashes and throws a java.lang.IllegalStateException. Here…
0
votes
1 answer

android scala send List through intent

I'm trying to send List[Ccountry] from one activity to another where Ccountry is a parcelable case class. All codes are written in Scala. Problem is I'm getting ClassCastException while sending the List in line intent.putExtra("foo",…
Sammy
  • 1
  • 2
0
votes
0 answers

C# example of Parcelable class with property List
Can someone please provide a simple C# example of passing an object through Intent using Parcelable method, where the object contains a List of another object? I really just need to figure out how to write/read the list. I have tested some code…
bashby82
  • 85
  • 1
  • 10
0
votes
3 answers

When to make an Object parcelable rather than just sending the primitive variables?

After researching for a while there is still something unclear for me: When is it worth to implement Parcelable rather than just getting the variables and send them to a new Activity? If i search for example for something like "RecyclerView click…
Florian Walther
  • 6,237
  • 5
  • 46
  • 104
0
votes
0 answers

ClassNotFoundException when unmarshalling (Passing object between differente apps)

I have a little problem about Parcelable objects and passing it between activities. I have two different apps, Activity A request Activity B by an Intent with startActivityForResult, B Activity sends back a custom object (Class C) which is defined…
0
votes
1 answer

Android DroidCharts SaveInstanceState Issue?

I am using JFreeChart ( http://www.jfree.org/jfreechart/ ) as a charting library. But for Android I use DroidCharts ( http://code.google.com/p/droidcharts/) which is basically JFreechart for Android. I have created a chart on android. Initially it…
Muhammad Shahab
  • 4,187
  • 4
  • 34
  • 44
0
votes
0 answers

Android Parcelable readString() under the hood

I have this simple model class here: public class News implements Parcelable { private String title; private String content; public News(String title, String content) { this.title = title; this.content = content; } …
agiro
  • 2,018
  • 2
  • 30
  • 62
0
votes
1 answer

Pass Object from one fragment to another fragment when recyclerView item is clicked

My MainActivity hosts 4 fragments. All the fragments are recycler views but 3 have a details fragment. I have the class below to implement recycler view click listener. public class RecyclerItemClickListener implements…