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

How to pass parcelable arg from activity to fragment with Android Annotations?

I have class ITEM and I want to pass array (Item[] items) of this class from ACTIVITY to FRAGMENT. Activity and fragment use Android Annotations. public class Item implements Parcelable { public int id; public String code; public…
Michalsx
  • 3,446
  • 5
  • 33
  • 46
0
votes
0 answers

java.lang.NullPointerException: Arraylist.size

I want to send arraylist to fragment class,but cant send using constructor.Then try using parcelable(1st time used) and still error(intent not stored arraylist).Hope you guys can help me solve this problem.Thank you. ERROR E/AndroidRuntime: FATAL…
khoi
  • 940
  • 1
  • 14
  • 29
0
votes
1 answer

How do I log the size of my Bundle in Mb?

I sometimes get TransactionTooLargeException in onSaveInstanceState. So, I'm assuming that the size of my Bundle being too large is causing this. I'd like to log its exact/approx size so I can get a rough estimate of the amount I need to minimize it…
Veneet Reddy
  • 2,707
  • 1
  • 24
  • 40
0
votes
2 answers

Using Parcelable, Realm and GSON in Android development

It is okay to use Parcelable, Realm, and GSON in one project in Android development? I'm just wondering how to implement it simultaneously because each of these libraries/frameworks has different annotations when making a POJO. Another one is Realm…
vidalbenjoe
  • 921
  • 13
  • 37
0
votes
2 answers

Android Fragment with savedInstanceState unparcelling Dagger2 injected model with constructor injection

i have an Android Fragment that injects a model for data binding. more specifically, i inject a ViewModel (defined in the Fragment's xml via a tag) and, call ViewDataBinding.setViewModel() to initiate the binding in onCreateView(). the Fragment is…
0
votes
2 answers

Stuck in generics

I've a base class BaseNewsItem, and 2 derived classes NewsItem and MovieNewsItem. Then, there's a MovieListingFeed class which holds a list of MovieNewsItem and is parcelable. It can parcel this list as and when required by any activity. protected…
gaurav jain
  • 3,119
  • 3
  • 31
  • 48
0
votes
1 answer

Android parcelable object passes to activity but not to service

I want to send a parcelable object to both an activity and a service. For sending to both I use: public void onClick(View view) { Intent intent = new Intent(mContext, MainActivity.class); Intent i = new Intent(mContext,…
Code Poet
  • 6,222
  • 2
  • 29
  • 50
0
votes
1 answer

Unmarshalling exception on Arraylist with a custom Parcelable Object

I am creating DTO for data array(from json) object and implementing parcelable to send arraylist of DTO to another class , but I am facing Unmarshalling unknown type code 7471216 at offset 476 this issue . I think there is some problem with List…
sharma.mahesh369
  • 985
  • 11
  • 28
0
votes
2 answers

Android: passing data between views

In my Android app, I have two custom view classes - PortraitClass and LandscapeClass. They both do the same thing. On running the app, the view class fetches some pictures from an SDCard and then maniputlates (skew etc) and displays them. The only…
Manny
  • 129
  • 7
0
votes
5 answers

How to get Parcable Bundle from Activity in a Fragment

I have written following code in my Activity Class, ArrayList data; data= Map.getDataList(); Bundle bundle = new Bundle(); bundle.putParcelableArrayList("data",data); Fragment fragment = new…
dev90
  • 7,187
  • 15
  • 80
  • 153
0
votes
2 answers

Sending Parcelable Objects as Serializable

The Android project in question already uses Serializable to pass information between internal modules. I am working on one of those Modules which also uses External Libraries to calculate Navigation Routes. I need to pass one of those "external"…
Raeglan
  • 514
  • 1
  • 5
  • 17
0
votes
1 answer

how to pass a list of objects of View in a bundle

i want to save the contents of an ArrayList of Views "ArrayList". i overriden the method "onSaveInstanceState" as shown below in the code, but at run time i receive the below posted logcat errors . please let em know how to set a list of View…
Amrmsmb
  • 1
  • 27
  • 104
  • 226
0
votes
2 answers

Passing data from MainActivity to Fragment

I'm trying to pass list of custom object from onDataLoaded function (which is in MainActivity) to fragment, using Parcelable. But I get this error... This is a MainActivity funkcion, onDataLoaded @Override public void onDataLoaded(List
0
votes
2 answers

Pass LinkedList to another activity

I have a Linked List in one activity (A) that I want to share with another Activity (B). The list contains a username of type string and contains coordinates of type LatLng. I am also using Intent and bundle to share data between activities. I…
Juan Sierra
  • 261
  • 2
  • 13
0
votes
2 answers

Passing data between fragment with calling value not reference

I'm trying to pass MyData(Parcelable object including ArrayList) from AFragment to BFragment. Certainly,it works.However, the reference of ArrayList is same. I've looked at various articles about Parcelable,and finally I found out that Parcelable…
Ank
  • 31
  • 5