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

Explanation about Parcelable Interface

I'm studying the Interface Parcelable and I'm facing some problems trying to fully understand how it works. On the internet I didn't find answers to some of my questions: I show you my Class: public class Media implements IModel, Parcelable{ …
MDP
  • 4,177
  • 21
  • 63
  • 119
0
votes
1 answer

xamarin android bundle put parcelable array

I need to save array of object in bundle, here is what I did : create class what is implementing IParcable interface: public class SimpleSelectorItem : Java.Lang.Object, Android.OS.IParcelable { public int Id { get; set; } …
Nininea
  • 2,671
  • 6
  • 31
  • 57
0
votes
2 answers

How to store SparseArray in Bundle?

How can SparseArray be stored in a bundle ? public void onSaveInstanceState(Bundle savedState) { // ... SparseArray values = mAdapter.getValues(); savedState.putSparseParcelableArray(values); the code above results in…
insane.bot
  • 193
  • 1
  • 2
  • 11
0
votes
3 answers

How to write to arraylist of two or more custom objects in Parcelable?

I have browsed the question on Stack and I found no question facing the particular problem. I have a class with two arraylist of custom objects. I am not sure how to implement writeToParcel for the parent class now. One option I found were…
legalimpurity
  • 180
  • 3
  • 13
0
votes
2 answers

Is it possible to put Activity in the parcel?

Below is the example of my Parcelable class. As you can see, I want to put activity in a Parcel, but how could I do that? I look into the source code of Activity, it is not Parcelable nor Serializable. public class MyParcelable implements Parcelable…
Sam
  • 351
  • 1
  • 2
  • 15
0
votes
1 answer

How to writeParcelable() a field of type that implements Serializable

e.g Class City that needs to implement Parcelable has field of type Location which implements Serializable. class Location is imported from a third party jar file and I cannot modify it. How do I successfully implement Parcelable for class City with…
chaitanyad
  • 998
  • 1
  • 9
  • 27
0
votes
2 answers

Parcelable encountered IOException writing serializable object - startActivity

I'm trying to create a registration system. I declare an instance of Profile one time in the first activity, then I use this same instance to pass to another activity. I already passed the same object over 4 times to others activities, but there's…
Adolfok3
  • 304
  • 3
  • 14
0
votes
1 answer

Parcelable of Custom Classes

I am currently trying to pass an ArrayList of the class event into another activity as follows.events is an ArrayList of the Event class. Intent i = new Intent(ViewEvents.this,…
0
votes
1 answer

How to get the keys from an object that seems to be matched dynamically. JAVA parcelable

I am having issues resolving this object it seems to be made completely out of a string then dynamically being matched to its key. if i try toString() this object it comes back with only the values(no keys) separated by a space. this is a…
jambuls
  • 111
  • 11
0
votes
1 answer

How to send a list of objects from one activity to another in android?

I have created the following class and using objects of this class. I want to pass a list of this class and send it to the next activity. class contact implements Comparable, Parcelable { String name; private String phone; …
sahaj jain
  • 27
  • 1
  • 7
0
votes
0 answers

IllegalStateException: Bad magic number for Bundle

Getting following error in Android while getting the control back to app after phone call ends. We have checked the complete code and confirmed that all objects implemented Serializable and while passing the data from one activity to another…
Ashish Chauhan
  • 39
  • 1
  • 10
0
votes
1 answer

How to convert a Android SqlBrite model class to implement Parcelable

I am building an app where I am using SQLBrite sql wrapper for all my database operations. Also, I am using Auto Value to handle all my getters and setters automatically using Google AutoValue library. Now, my issue is to handle the device rotation…
0
votes
1 answer

Bundle loses its values between activities

I use the following codes to start activity with bundle extras data, and I can see the data has saved in Intent extras: public static Intent newIntent(Context packageContext, AccountItem account, TransactionItem transaction) { Bundle args = new…
Weiyi
  • 1,843
  • 2
  • 22
  • 34
0
votes
1 answer

Pass custom objects between activities using Intent

I wondered if it makes sense to make a class that inherits from the Intent class and that overloads the putExtra method, allowing to pass custom objects, instead of using Parcelable. Is it something sensible? Is it much slower than passing…
Robin
  • 605
  • 2
  • 8
  • 25
0
votes
1 answer

what is the best practice for getting JSON from other activity

i was wondering what is the best practice to get a JSON and to display it, from one to activity(with NO GUI) to an other activity(WITH GUI),i found couple methods ranging from just passing the jsonobject in the PutExtra, to making a Parcable class…
rollcage
  • 101
  • 1
  • 10