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

Class B extends Class A but class A has a property of class B

So I know this is confusing but why does this work? If I have public class A implements Parcelable{ private B propB; } public class B extends A implements Parcelable{ private int stuff; } so if I ever created a A objectA = new A();…
reidisaki
  • 1,525
  • 16
  • 29
0
votes
5 answers

How to pass an object to another activity? If the object already implements an interface (so it can't implement Parcelable)?

I'm trying to pass an Object from one activity to another and I know I should use Parcelable or Serializable but my Object class implements an interface already. Is there any way around this?
John
  • 1,808
  • 7
  • 28
  • 57
0
votes
3 answers

How to get the value of ListView and save it in the EditText or something else in another activitiy

There is any activity with an input field, it calls the second activity with ListView. I need to get the value from the ListView and return it to the input field in the first activity. Can not return a value, but the activity switches without…
0
votes
1 answer

using viewpager , image is not showing

I have the below code trying to use ViewPager. The problem is the image is not being displayed, I guess the problem is the fragment is not being accessed ( or "called") can you identify why? I have added a print in the Fragment method to check if…
Moudiz
  • 7,211
  • 22
  • 78
  • 156
0
votes
1 answer

Why is Parcel.ReadStringList() writing an empty list in MonoDroid?

I'm using a custom parcelable object called GameSettings to pass a number of settings between Activites within an Android app (developed using MonoDroid). The settings are stored as properties on this GameSettings class, and up until now they've all…
0
votes
0 answers

How to get items from model class after passing in intent android?

History is a model class which has userName,msgType, rowId. After getting result, i just passing in list in another activity. How to parse and get each items from History class? Here is code public void getHistory(List arg0) { …
0
votes
1 answer

GSON deserialize to bundle

How can i deserialize this JSON: "data": { "key1": 11, "key2": { "key3": 22 "key4": 83 "key5": 99 } } to an Android Bundle using GSON library? This is not working: class Model implements Parcelable { private…
Jumpa
  • 4,319
  • 11
  • 52
  • 100
0
votes
1 answer

Parsing Dynamic JSON Data with Gson and Store it in SQlite DB in Android

I get this JSON response from server in my Android application and I want to parse this data by Gson , In Json Response permission tag of my may contains 20-25 data with key like 1, 2,... every value of the permission contains two information…
chotemotelog
  • 233
  • 1
  • 4
  • 13
0
votes
1 answer

Class not found when unmarshalling error. Parcelable with byteArray, byte[]

I have an error when using a Parcelable Class. I'm trying to pass an image as a ByteArray between activities, and eventually to a remote webservice. java.lang.ClassNotFoundException: ... Class not found when unmarshalling: import…
Greg
  • 689
  • 2
  • 8
  • 23
0
votes
1 answer

How to make my Custom Model Parcelable with custom object in it's Constructor

This is my class that I'm trying to make it Parcelable, As you can see in code I Stuck in some places in code: public class CommentModel implements Parcelable{ String COMMENT_CONTENT; String COMMENT_ID; UserModel …
MAY3AM
  • 1,182
  • 3
  • 17
  • 42
0
votes
0 answers

Serialize a Parcel(able)

I find a bunch of tutorial of serialize vs Parcelable etc. But I have this question : I have an object that implements Parcelable because I have to pass it through IPC. But this object should also be stored in a raw way in a db. Is there a…
hl037_
  • 3,520
  • 1
  • 27
  • 58
0
votes
0 answers

Android parcelable out of memory

I am creating an application in which I have a "Game" object which holds some information about the game. Here is my code Game.java import android.os.Parcel; import android.os.Parcelable; import android.util.Log; import java.util.Arrays; /** *…
mp3por
  • 1,796
  • 3
  • 23
  • 35
0
votes
1 answer

Parcelable content not updating

I have a JSON message being sent to a listening service in my first Android app (read: pelase be gentle!) that is mapped to an object that implements Parcelable. The deserialized object is used to display a notification, with an intent that is meant…
k3davis
  • 985
  • 12
  • 29
0
votes
1 answer

How to parcelize or serialize POJO classes?

I wrote this Java parser library which outputs a set of POJO classes: Offer Room Stream Url VideoSize Since I want to use the parsed data in an Android project I am running into a problem: the model classes are not parcelable nor serializable. The…
JJD
  • 50,076
  • 60
  • 203
  • 339
0
votes
1 answer

Making JSONObject parcelable

I have an array list of JSON Objects that I'm trying to pass like so. ArrayList entryCities = new ArrayList<>(); for(int i = 0; i < entries.length(); i++){ entryCities.add(entries.getJSONObject(i)); } Intent intent = new…
Rafa
  • 3,219
  • 4
  • 38
  • 70