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

Android: nullPointerException when using Parcelable interface in class with ArrayList

I am trying to make the class called Music use parcelable so I can access an instance of Music in two different activities. I don't want to use serializable for speed purposes. I keep getting a nullPointerException when I try to pass it…
user2726232
  • 131
  • 11
1
vote
1 answer

Android: How can I make a class that implements Parcelable which contains an ArrayList of a non-static custom class

In the class I am trying to make parcelable there is a smaller class called genericSongClass. In the larger class there is an ArrayList of genericSongClass's. So I know I have to make genericSongClass parcelable, but I cannot give it a CREATOR…
user2726232
  • 131
  • 11
1
vote
1 answer

Class cast Exception while sending object to another activity

I try to send one object with Intent. I have three class, class A has a list of Class B and class B has a list of class C, and i want send class A from one activity to another with the Parcelable. i try following code: in Class A: private…
Shayan Pourvatan
  • 11,898
  • 4
  • 42
  • 63
1
vote
1 answer

Synchronizing parcelable state between Activities?

I have Parcelable object that holds a query and offset to web API. Then I have two Activities: Activity A with a list and Activity B with a ViewPager. User navigates from Activity A to B, and Parcelable is passed in Intent. In Activity A query is…
pixel
  • 24,905
  • 36
  • 149
  • 251
1
vote
0 answers

Unmarshalling parcelables from an InputSream

I have an InputStream (serialized bytes) containing marshalled Parcels with Parcelables inside them. I need to unmarshall and inflate the Parcel back up again so I can retrieve the Parcelable. How can I do this, when I don't know the length of the…
JohnyTex
  • 3,323
  • 5
  • 29
  • 52
1
vote
2 answers

Pass 2D object between activities

I know there have been a lot of questions on this topic but I can't find an answer for my specific case. Basically I have a two dimensional array of a fairly simple class that I need to pass. I am trying to use Parcelable and I ran my class through…
Gavin
  • 460
  • 4
  • 11
1
vote
1 answer

ClassCastException when trying to pass custom object implementing parcelable to another activity using Intent

I have my own Object SineWave which I need to pass from SettingsActivity to SimulationActivity But it gives a classcastexception when I cast SineWave[] to Parceable[]. SineWave object:- public class SineWave implements Parcelable{ float…
udiboy1209
  • 1,472
  • 1
  • 15
  • 33
1
vote
2 answers

Parcel: unable to marshal value - Fragments

my app crashes when I try to launch navigation on browser. I've read something about implement Parcelable (here), but I don't have any idea on how to do it. This is the first time I work with Fragments and they are a PIA. I've modified this project…
Luis
  • 447
  • 1
  • 7
  • 24
1
vote
2 answers

Get error when trying to write to a Parcel

In my Parcelable class, inside the writeToParcel method, I get this error: Inferred type 'MyObject' for type parameter 'T' is not within its bound; should implement 'android.os.Parcelable when I try to write an ArrayList, by this…
androidevil
  • 9,011
  • 14
  • 41
  • 79
1
vote
1 answer

Pass List with Parcelable

i have a problem with my parcelable. I think that almost everything is ok, but it still not working, I dont know why but here is my code categoriasParcel public class categoriasParcel implements Parcelable{ public List categorias; public…
luisurrutia
  • 586
  • 6
  • 21
1
vote
1 answer

Getting payment configuration from PayPal lib

I'm using PayPal in my monodroid application. I used the libraray that has been shared in this topic: http://forums.xamarin.com/discussion/comment/15331/#Comment_15331 But i have a problem at getting PaymentConfirmation object at OnActivityResult…
Husein Behboudi Rad
  • 5,434
  • 11
  • 57
  • 115
1
vote
1 answer

Should I make a class both serializable and parcelable?

I have just created a class for an android application that I am currently making. I made it parcelable so that I can efficiently send objects of this class between activities. However, I would also like to save these objects to internal storage. …
Shane Dev
  • 11
  • 2
1
vote
2 answers

How to object from one Activity to another Activity in Android?

I am badly stuck to pass object from one activity to another activity using Parcelable but I am getting null pointer exception at line Log.i("Name",""+rcp.getName());, you can check this line in below code. Plz do check code CookingDataModel class…
user2391890
  • 639
  • 1
  • 8
  • 15
1
vote
1 answer

Should I implement writeToParcel method?

I happen to know what if my class Info which implements Parcelable has empty writeToParcel() method, Bundle.putParcelableArrayList() and Bundle.getParcelableArrayList() methods still work on ArrayList< Info>. public class Info implements…
Alexander Prokofyev
  • 33,874
  • 33
  • 95
  • 118
1
vote
0 answers

Android: writeToParcel is giving overflow error

I am trying to save my custom view (DrawView) on Orientation change. The code works perfectly fine when the orientation changes but when i minimize the screen or press home button on my device I get the stack overflow error... Can you please help…
Parampal Pooni
  • 2,958
  • 8
  • 34
  • 40