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

Parcelable with optionally populated values

I am getting information from Google Place Search API. I can decode the JSON Object just fine on my first Activity. I would like to take the user to a details page so I am trying to pass the information via a Parcelable. When an attribute isn't…
Sheridan Gray
  • 698
  • 1
  • 9
  • 23
0
votes
2 answers

NullPointerException received when calling Bundle.getParcelable

I have a problem that I am trying to solve for few hours but cannot solve it and I need some help. I am trying to retrieve URL strings from a Login activity and trying to pass it to the Main activity using a parcelable object but I receive…
Noorul
  • 939
  • 1
  • 11
  • 21
0
votes
2 answers

Send array through intent?

I am trying to send an array of StatusBarNotifications to another service of mine so I have tried this: Service that extends NotificationListenerService: @Override public void onNotificationPosted(StatusBarNotification sbn) { // TODO…
REG1
  • 486
  • 4
  • 15
0
votes
1 answer

How to unparcel object where field is a subclass?

I'm in a position where I have to implement Parcelable interface on a class that has a custom field that could be any subclass of Shape class: class MyClass implements Parcelable { Shape shape; } now, If I want to write the shape field to the…
mick88
  • 852
  • 1
  • 8
  • 12
0
votes
2 answers

Parecelable with children

I've been reading on this matter but I have not found a solution yet. I want to use the method onSavedInstance to save an array of objects with the type Cell but all the objects inside the array will be children of Cell. My main problem is that I am…
CarlosMorgado
  • 315
  • 2
  • 10
0
votes
2 answers

How to save List that implements Interface on onSaveInstanceState

I have in my Activity : List mt; this.mt = new ArrayList(); Inside the mt list I have Objects that implement IntManager Interface, but they are let say type of Point (my custom class) Now I want to save the this.mt in the…
Dima
  • 443
  • 2
  • 9
  • 23
0
votes
2 answers

Android Parcelable Understanding - parcelling not working

So I thought I would try out Parcelling in Android today, quickly mocked this up: public class Unit implements Parcelable { private String unitName; private int view; private Double value; /** * Constructor */ public…
user2405469
  • 1,953
  • 2
  • 22
  • 43
0
votes
2 answers

Android: Parcelable class that contains a parcelable field

NOTE: the solution is in the answer starting with SOLUTION that I can't accept since it's my own anwer. I hope this helps someone else. I want to make my class, that includes a parcelable object, parcelable. In other words let's say I have a class…
user2294708
  • 65
  • 1
  • 9
0
votes
0 answers

Share one same object reference when passed by parcel

FileDownloader: public class FileDownloader implements Parcelable { int file_size = 0; // Ignore other logic code here public int get_file_size() { return file_size; } public void start() { Intent download_service = new…
Daniel
  • 861
  • 1
  • 8
  • 12
0
votes
1 answer

Android How to pass interface reference by intent

ProgressUpdateListener: public interface ProgressUpdateListener { public void on_update(int downloaded_size); } FileDownloader public class FileDownloader implements Parcelable { ProgressUpdateListener listener; public…
Daniel
  • 861
  • 1
  • 8
  • 12
0
votes
1 answer

Comparator Parcelable
After hours of searching, I don't know how to make a Comparator parcelable. I found this "Parcelable stuff" a bit "missing content"... (Parcelable don't have even a writeBoolean) public class T implements Parcelable{ ... public static…
myz
  • 293
  • 2
  • 10
0
votes
2 answers

How correctly implement a SparseArray to store a custom object on each instance of a ViewPager? Android Development - Java

First I'd like to thank you all for your time and help, in advanced. My question is probably a basic, and silly one. However, I am a beginner and I guess this is a good place to learn! So, I have a custom object called Question, and it is described…
Leon92
  • 505
  • 1
  • 9
  • 15
0
votes
1 answer

Android AIDL and Service and Activity parceable seems to be passing default class values

I have a strange issue going on, I have created an Android service, and a widget that consumes it. I have some complex objects that are sent between the two via AIDL. I have no problems registering my callbacks, and the service is populating the…
bhawkins
  • 326
  • 2
  • 11
0
votes
1 answer

Sending list of custom objects as an intent to another activity

I have a class Tag Model and i need to send List< TagModel> to another activity. If i implement parcelable then I have another custom object array list in its items. How to solve this problem? public class TagModel { int listing_count; …
Abhay Sood
  • 480
  • 2
  • 6
  • 20
0
votes
2 answers

Android: Parcelable ClassNotFound Unmarshalling Crash

So I've checked over a lot of different posts and I'm still not finding a solution for this problem. It's probably something small that I'm just not noticing, but I figured I'd get additional sets of eyes on the issue :) Model object in one of my…
Paul Ruiz
  • 2,396
  • 3
  • 27
  • 47