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

Values are changed when inserted in Bundle

When I put an object into a bundle so I can transfer it to another Activity, changing the value of the attribute IdEscritorio occurs. In my LoginActivity IdEscritorio the value of = 1, when I get in my Main Activity is it with the value of…
Renan Barbosa
  • 1,046
  • 3
  • 11
  • 31
1
vote
2 answers

ArrayIndexOutOfBoundsException when parceling set of enums

I can't see the error, I'm having this problem for a long time already... My parcelable class crashes if it is recreated, but I can't find the problem... I checked the order of writing/reading data. I checked the functions I use (direct…
prom85
  • 16,896
  • 17
  • 122
  • 242
1
vote
1 answer

Reading and Writing UUID, images, audio, and video while implenting Parcelable

I would like to implement Parcelable in a custom class I have written so I can pass entire objects from fragment to fragment. Each object will contain a UUID, a String, an image, a video, audio, or some combination of the four. I'm also considereing…
pez
  • 3,859
  • 12
  • 40
  • 72
1
vote
3 answers

Share Parcelable object from Fragment to Activity

Hello i try to pass object from Fragment to Activity like next: Bundle bundle1 = new Bundle(); bundle1.putParcelable("company", companies.get(i)); Intent intent = new Intent(getActivity(), CompanyInfoActivity.class); intent.putExtras(bundle1); …
Kostya Khuta
  • 1,846
  • 6
  • 26
  • 48
1
vote
1 answer

Passing Parcelable/Serializable vs Passing object's data members

I'm trying to figure out what is the most efficient way to pass an object from one activity to another in android. I read I can extend an object as Parcelable or Serializable, and it seems like Parcelable is the clear winner in terms of…
kyrax
  • 1,192
  • 3
  • 13
  • 29
1
vote
1 answer

Android Parcelable String null

I am sending an object from an antivity to other. the class is: public class Reparacion implements Parcelable { private int tipo; private int estado; private int id; private String razonSocial; private String direccion; private String…
user3235831
  • 45
  • 11
1
vote
1 answer

Parcel Unmarshalling unknown type code when reading list of custom classes

I'm trying to implement my custom classes as parcelable and I'm having a problem reading/writing a list of these classes from the parcel. I have 3 classes, Quiz, Question and Answer. It is giving me an error under the question class, on the line: …
dgzz
  • 2,929
  • 6
  • 34
  • 56
1
vote
1 answer

Android Parcelable List

I have a JSON and i wanted to put it into parcelable class so that i can pass its object from one activity to other. i have used Parcelable before several times. but this time i got confused with how to create the parcelable class with below JSON…
NaserShaikh
  • 1,576
  • 2
  • 23
  • 39
1
vote
1 answer

Android Parcelable finals

So, i have the following class, which i want to serialize using Android Parcelable public class Parent{ public static final int x; //primtive type public static final Animal y; //another percelable public static final String z; //object…
minhaz
  • 4,233
  • 3
  • 33
  • 49
1
vote
0 answers

saving and restoring state of View Pager with Pager Adapter

I am using a view pager with pager adapter.The catch is that I cannot use Fragments.So everything has been done using views.Here's the code private class MyPagerAdapter extends PagerAdapter { private View temp; public MyPagerAdapter() { …
1
vote
2 answers

Android Error sending ArrayList in between Activities on Android. Parcel: unable to marshal value com.parse.ParseObject@b308c828 error

I'm trying to send an arrayList of ParseObjects from one activity to another with the following code: Intent intent = new Intent(MainActivity2.this, Activity2.class); intent.putExtra("arrayList", list); startActivity(intent); where list is the…
1
vote
2 answers

How to store ArrayList> with Parcelable interface between Activities

I want to store ArrayList> arrayListsTransportsForAllStops between activities. Class Transport implements Parcelable. But when i try to make intent.putParcelableArrayListExtra("transports",arrayListsTransportsForAllStops); My…
Kostya Khuta
  • 1,846
  • 6
  • 26
  • 48
1
vote
1 answer

Parcel a List<> of custom object with Bitmaps inside

I need to pass from one Activity to other a list of news (it's a RSS reader) for to display them in a ViewPager. All data about news is stored in a class: public class SingleNew implements java.io.Serializable{ public String title; public…
korima
  • 306
  • 5
  • 12
1
vote
2 answers

EXTRA with parcelable comes out NULL but without its fine

I am getting a bit frustrated with an issue that I cannot seem to fully understand. I have a listview with items and when I click them I want to pass an object (Parcelable) to a new activity. This is the code…
Filipe Picoito
  • 673
  • 6
  • 23
1
vote
1 answer

Intent putExtra with array of object implementing Parcelable

I want to add an array of instances of Person class, this class implements Parcelable. I tried the code below setResult(Activity.RESULT_OK, new Intent().putExtra("persons", persons)); finish(); to store the array in an intent from the sender…