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

Display passed parcelable data to xml layout in Android

Despite checking many questions in stackoverflow and google, i could not find the solution to this problem. Can someone post and explain a sample code how to use parcelable in Android with multiple data and how it will be passed and displayed in an…
0
votes
1 answer

Parcelable changes resource id on Android

I have Product class which is implements Parcelable. This class have some images these images path keeps in strings.xml. I have product object to another activity, but image resource changes. So, I get ResourcesNotFoundExceptions. Here my…
abalta
  • 1,204
  • 1
  • 12
  • 21
0
votes
1 answer

source.readList of Parcelable doesn't work over List

This line is red flagged by IDE : mBook.Color=source.readList(Color,Book.class.getClassLoader()); I also changed to mBook.Color=source.readList(Color,String.class.getClassLoader()); but still wrong, I thought it's because my code was missing…
0
votes
1 answer

RuntimeException when Unmarshalling Android Intent Parcelable

I have an Object that I am passing between activities. In this Object there are seven variables. One of those variables is an ArrayList that is from another class. I have implemented Parcelable on both. Here are the errors: 09-08 17:00:04.212…
Giovesoft
  • 580
  • 6
  • 21
0
votes
2 answers

How to pass a list of custom object through the method View.onSaveInstanceState()?

I have searched the, "custom object passing" issue all over the Internet. There are several solutions but they are all using an Intent to communicate. With Intent, there are methods to facilitate that but what about the method public Parcelable…
Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105
0
votes
0 answers

Android nested class Parcelable Strange behavior

So I encountered an issue when passing object using Parcelable to another activity My Model : public class PostModel implements Parcelable { @SerializedName("consumer") public ConsumerModel consumer; @SerializedName("attachments") …
Karate_Dog
  • 1,265
  • 5
  • 20
  • 37
0
votes
1 answer

How to gracefully handle Parcelable implementation changes when storing to disk after all?

I'm currently writing a View library that gets rid of the need for Activities and Fragments and should be more easy to understand and so on and so forth. Anyway that's my goal. However I struggle to come up with a solution on how to store state. I…
domenukk
  • 953
  • 15
  • 28
0
votes
1 answer

Problem getting same class instance passed from one activity to another

I am trying to pass SampleParcelable class object say sampleObj from my ClassA (current) activity to ClassB (a new one), but when i log the objects value, the object's value which i am creating in ClassA is totally different from what i get in…
Rachna
  • 213
  • 4
  • 17
0
votes
1 answer

I have corrupted data with Parcelable implementation

I have implemented Parcelable interface for my RealEstateAd. However my data get corrupted on each transfer between activities. Initial data (to be passed to activity # 2): classOfProperty = 101 typeOfAd = 102 <-- Note this value. typeOfAdvertiser =…
malhobayyeb
  • 2,725
  • 11
  • 57
  • 91
0
votes
1 answer

Xamarin Android - Unable to start activity ComponentInfo{[activityName]}: java.lang.RuntimeException: Parcel android.os.Parcel@[address]

Recently, we have been getting a few of following exceptions in our app: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.android/com.myapp.android.WelcomeActivity}: java.lang.RuntimeException: Parcel…
Jakub Holovsky
  • 6,543
  • 10
  • 54
  • 98
0
votes
1 answer

Android : Class not found when unmarshalling java.lang.ClassNotFoundException

My class PhotosList: public class PhotosList extends DataList { public PhotosList() {} @SuppressWarnings("unused") public PhotosList(Parcel source) { super(source); items = new ArrayList<>(); source.readList(items,…
anthony
  • 7,653
  • 8
  • 49
  • 101
0
votes
3 answers

Can't save fragment state in Android while configuration is changed

This type of question is asked many times in SO, I have tried all of them, but couldn't achieve what I actually want. In my app I have Fragment, inside that fragment I have a recycler view. recyclerview would be manipulated by the data which I have…
0
votes
1 answer

Make a class with several objects of multiple subclasses parcelable in Android

I have a class containing 2 subclasses and have several instances of those subclasses. ClassA{ private ClassB obj1; private ClassB obj2; private ClassC obj3; private ClassC obj4; private ClassC obj5; private ClassC obj6; private class…
Ma_Wo
  • 3
  • 2
0
votes
0 answers

Parcelable class returns null when converting from JSONArray

JSON Data downloaded from google sheet { Sheet1: [ { first_name: "Guy", last_name: "Man", first_n_last: "Guy Man", date: "2016-07-15T05:00:00.000Z", customer: "Company", jobtype: "Outage", …
Janon
  • 1
  • 1
0
votes
1 answer

Custom Parcelable object passed to core

I want to send a broadcast message with intent within extra data of my custom type which implements Parcelable. In more details: I want to create a shortcut on the HS However system does not accept object of my custom Command type, error message:…
Solvek
  • 5,158
  • 5
  • 41
  • 64