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

Passing Parcelable item between activities

I'm having trouble passing an object via an Intent. I keep getting a null pointer error. here it is: In my ListActivity: @Override protected void onListItemClick(ListView l, View v, int position, long id) { Intent intent = new…
AndroidDev
  • 20,466
  • 42
  • 148
  • 239
1
vote
2 answers

creating parcelable in android from some of the fields of a class

i have the following class which i intent to pass from one activity to another: public class Ad extends ListItem implements parcelable{ private String _type; private String _recordID; private String _line1; private String _line2; …
Isaac Cohen
  • 158
  • 1
  • 13
1
vote
1 answer

getParcelableExtra() crushing after Starting activity when passing an object

Im trying to pass an object between activities but my app crushes: This is my class (the object im passing through the intent): public class item implements Parcelable { private int id; private String title; private String desc; private double…
mn6vdv23g
  • 734
  • 2
  • 10
  • 33
1
vote
0 answers

How to put Simple XML Serialization model-objects into a Bundle?

I am using the Simple XML Serialization library in my Android app for parsing and mapping an XML response from a web service to objects, like so: @Root(name="root_tag", strict=false) public class XMLRequest { @Path("a/b") …
Blacklight
  • 3,809
  • 2
  • 33
  • 39
1
vote
0 answers

Why must override function: writeToParcel from interface Parcelable in android?

I have a class: class PartStoreModel implements Parcelable which contains some properties such as: id, name, address. In this function I must override function: public void writeToParcel(Parcel dest, int flags) (I left this function empty, don't do…
Kingfisher Phuoc
  • 8,052
  • 9
  • 46
  • 86
1
vote
2 answers

How to read/write int in Parcelable object?

My int variables are not reading/writing correctly in my Parcelable object. I am passing my object from one activity to another but the int variables are not the same once I pass it and read it. Heres my code. PARCELABLE OBJECT: class someObject…
Instinct
  • 2,201
  • 1
  • 31
  • 45
1
vote
1 answer

ClassCastException - Parcelable objects/Custom object

ive searched days here searching for a solution, but i cant find it. I have a Activity who send an object through activities. But, when the "readParcelable" begins, after a few objects the CastExceptionError appears, ive debugged several times this…
krustbr
  • 13
  • 1
  • 4
1
vote
2 answers

Holding data model in android application

Currently I'm writing android application, whose main functions are just fingerpainting on screen. The main problem is how to store application's data model. What would be the best practice? Currently data model looks like this: public class…
msnw
  • 93
  • 7
1
vote
2 answers

To pass a parcelable arraylist of objects

I trying to pass array of objects via Parcelable. But after the transfer, the data is converted into something strange The transmitting part: for (int i=0; i
ftp27
  • 885
  • 1
  • 12
  • 31
1
vote
1 answer

Provide the code of Parcelable objects to AIDL clients

The documentation states: If you have a class that you would like to send from one process to another through an IPC interface, you can do that. However, you must ensure that the code for your class is available to the other side of the IPC channel…
cYrus
  • 2,976
  • 6
  • 29
  • 47
1
vote
3 answers

Saving Parcelable data

I have a class which implements Parcelable, and could not implement Serializable because it contains some basic Android classes that I can not modify. Some of the objects in this class are for example Location and PendingIntent (which are all…
Mugen
  • 8,301
  • 10
  • 62
  • 140
1
vote
1 answer

unmarshalling exception with parcelable

I try to pass a parcelable object with an arraylist of integer but i got an error when android try to read the parcelable object 03-31 19:20:12.484: E/AndroidRuntime(21448): Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@4172c410:…
ulquiorra
  • 931
  • 4
  • 19
  • 39