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

Writing/reading an ArrayList of Parcelable objects

I have a class called ClassA which contains a List of ClassB objects. Both classes implement Parcelable. I am trying to create the read/write methods for this list in ClassA and am having trouble. For example I tried: @Override public void…
KaliMa
  • 1,970
  • 6
  • 26
  • 51
0
votes
2 answers

Pass List<> to a Fragment

I'm creating an Android map app by getting venue from Foursquare and using Google Map. I have set my MainActivity to get the venue results, a MapFragmentClass and a VenueModel. I keep all the JSON result from Foursquare into a List venueModelList in…
0
votes
2 answers

Android Parcelable implemenation without getters and setters

In android developers documentation to avoid getters and setters Android Performance Pattern How create Parcelable implemented model class?
Vinayagam.D
  • 322
  • 3
  • 10
0
votes
2 answers

Why is this implementation of parcelables to save and restore Custom Arraylist not Working

I am fetching data from json with Volley and populating RecyclerView with the parsed data but I ran into a bit of problem: The call to get the items is in onCreate method, so the call is repeated each time the activity is recreated both from…
X09
  • 3,827
  • 10
  • 47
  • 92
0
votes
1 answer

how to pass a thread class object from activity to activity using parcelable

ok i am making an app for some bluetooth works so there is thread class which i used to connected with other device and now i wanted to pass that thread class instance to another activity so i doesnt have to reconnect it therefore i implement that…
Abhishek Kumar
  • 165
  • 1
  • 17
0
votes
2 answers

Parcelable ArrayList is always empty

I want to pass ArrayList via Intent to another activity. However, the code doesn't give any errors but List is always empty. Any idea what i'm doing wrong ? ty Activity1 private ArrayList rbList = new ArrayList(); …
user6112961
0
votes
4 answers

Android passing the parcelable object List between activities

My problem is after i pass the list to second activity i can not cast it to list back. Its crashing app.I tried with try catch but still no exception. Any idea what im doing wrong ? Tyvm. Activity 1 private ArrayList rbList = new…
user6112961
0
votes
2 answers

Parcel returning null boolean array

I have created a parcelable object which contains a boolean array public class Alarm implements Parcelable { private int hours; private int minutes; private int alarmTime; private int ID; private boolean alarmSet; private boolean[] days; private…
user3074140
  • 733
  • 3
  • 13
  • 30
0
votes
0 answers

Get array list item from parceable class and display in Fragment View

I have a class that implements parceable. My question is that i am able to get values from the individual fields and display in the Fragment View.But My method getAnswers() is unable to display the string value of this array. in that same Fragment…
jonathan
  • 29
  • 1
  • 11
0
votes
0 answers

How to convert Parcelable to Generic Type in Android?

Note: Please read the full question and if anyone knows the answer or any suggestion feel free to tell me I am using retrofit 2 for downloading blog data from internet in Json format and show them in a list using recycler view.I set my recyclerview…
Niyamat Ullah
  • 2,384
  • 1
  • 16
  • 26
0
votes
3 answers

Is it necessary to make members of custom classes parcelable in order to make the class parcelable

public class Movie implements Parcelable { private int id; private String poster_path; private String overview; private String release_date; private String original_title; private String backdrop_path; private float…
fiddlest
  • 1,262
  • 2
  • 17
  • 42
0
votes
2 answers

How can I use Parcel class to send an object with complex attributes to another activity?

I need to send an object ModuleDetection from an activity to another. I've found that using the Parcel class to turn my object into a Parcelable object would help me. However, in every example I could find, the parcelable object's attributes had…
0
votes
3 answers

How to make class with multiple Integers and Strings Parcelable?

I have following Class and i want to make it Parcelable Problem is that when i read isHidden and Counter variable from int[] arraySongIntegers by method in.createIntArray() , i am getting an empty array of size 0 and BTW all the String variables are…
Devansh Kumar
  • 1,552
  • 1
  • 15
  • 27
0
votes
2 answers

Why I not get List ArrayList data from separate AsyncTask class to Fragment Class?

Please Help Me where I'm wrong. I'm new and tired with this problem. I have a class ForcastTask extends AsyncTask, another class ForcastFragment extends Fragment implements AsyncResponse and Main Activity class. I want to get onPostExcute(List data)…
0
votes
1 answer

Android - Implementing Parcelable Inner Class

I know how to implement a simple Parcelable class with public variables but the class below is somewhat more complex. How can I implement the Parcelable interface given that this class has an inner class and ListEntity? I'm not even sure how to…
CBA110
  • 1,072
  • 2
  • 18
  • 37