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

getting value from different activities with getParcelableExtra()

I have two activities that are called DrinksActivity and FoodsActivity. Both have their own RecyclerViews to display items. They work well, but I have to pass their values to another activity called.. sample_activity. This is how sample_activity…
Danny
  • 13
  • 5
0
votes
3 answers

How to pass data between two activities

I have a NetworkList class which has a arraylist of type string. I am using parcelable interface in it.but i am getting only the first element of arraylist in my new activity. how can i get all the elements? here is NetworkList class public class…
Arihant
  • 189
  • 1
  • 1
  • 9
0
votes
1 answer

TextView not appearing. Blank CardViews

I'm currently working on a basic shopping cart project where I select items from a RecyclerView and add them to a custom ArrayList which should then be seen in EstimateActivity in a new Recycleview. I'm able to add custom objects to the "cartList"…
0
votes
0 answers

java.lang.ClassCastException: android.os.Parcelable[] cannot be cast to com.hfad.myapp.MyObj[]

I want to pass MyObj[ ] between activities. I'm using an Intent and Parcelable to do so, but when I try to receive that data in Activity B I get the error: "java.lang.ClassCastException: android.os.Parcelable[] cannot be cast to…
Kamil Radz
  • 47
  • 1
  • 10
0
votes
1 answer

Android, Share custom data via Sharesheet?

I'm trying to share custom data using the Sharesheet and the first question is: is it possible? Example: In my app there is an address book and I want to share with a friend via Whatsapp a single contact [class: Contact]. When he receive the message…
Hosaz
  • 7
  • 7
0
votes
1 answer

Android Parcel: Writing an array list

Does writing an ArrayList to a parcel create a copy of the list when you read it back? My custom objects are Parcelable and I make sure I don't create copies. I need to be able to pass an ArrayList forward to other activities through intents and I…
tchristofferson
  • 183
  • 1
  • 1
  • 14
0
votes
2 answers

How to implement Parcelable on my class which contains an ArrayList?

I just want to know how to read and write the ArrayList. I use Kotlin. data class CustomerTxn( @field:SerializedName("txn_note") val txnNote: String? = null, @field:SerializedName("txn_date") val txnDate: String? = null, …
0
votes
1 answer

Error: Required: Image, Found:Image & Parcelable

While trying to get multiple selected images from gallery, there is a compatible issue as shown in screenshot when i use image array list. What could be the solution? @Override protected void onActivityResult(int requestCode, int resultCode,…
techno
  • 47
  • 1
  • 7
0
votes
1 answer

How to pass string from activity to another activity in kotlin

I am trying to pass over a text to my second activity but it does not seem to be working correctly. For my main activity i have a a textview and the text says 'Cat'. When the image on the first activity is pressed on, I want "Cat" to be passed over…
penfew
  • 55
  • 4
0
votes
1 answer

getParcelable crashes on release mode but works fine when install through android studio

public class Details implements Parcelable { @Ignore protected Details(Parcel in) { id = in.readLong(); timestamp = in.readString(); type = in.readInt(); } @Ignore public static final Creator
CREATOR = new Creator
()…
Umer Khalid
  • 330
  • 2
  • 16
0
votes
1 answer

SerializedName annotated member is getting obfuscated in release build Android

In recent release build creation, one of my classes which had @SerializedName member was getting obfuscated, which didn't happen in previous release. My class: data class Segments( @SerializedName("list") val list:…
0
votes
1 answer

Using @Parcelize but by removing Getters and Setters in kotlin

I'm trying to neglecting getter and setter in kotlin using @Parcelize. But little bit confused, here. class College : Parcelable { var studentFound = true set(value) { field = value studentFoundEvents.onNext(value) } val…
Horrorgoogle
  • 7,858
  • 11
  • 48
  • 81
0
votes
1 answer

Can't retrieve extra data in new activity

I have implemented Parcelable into an Object I want to pass between activities when I click on a CardView inside a Recycler View. The only problem is the object (ResultsHelperClass) always has modified values upon receiving the intent. I'm…
0
votes
3 answers

ClassNotFoundException when unmarshalling a Parcelable

I have a problem with parsing a Parcelable across an Intent. I create parcelable using Intent data = new Intent(); data.putExtra(ShoppingListAdapter.parcelName, la); setResult(Activity.RESULT_OK, data); I receive it in the…
Alex
  • 1,315
  • 4
  • 16
  • 29
0
votes
2 answers

setSingleChoiceItems of ParcelableArray (Kotlin)

have a code: val booksForDelete = arguments?.getParcelableArray("books") val builder = AlertDialog.Builder(activity) val checkedItem = -1 builder.setTitle("Choose the book for DELETE") …