1,665
questions
0
votes
2
answers
21
views
android parcelable cast crash release version
I am working on a flutter project that integrate RFID android pistol device to the application.
Using pigeon to communicate to native android api.
While debuging android studio at RFID device I ca ...
0
votes
1
answer
40
views
Unparcelling of ... of type VAL_PARCELABLE consumed 2068 bytes, but 3496 expected
When I unparcel my Kotlin data object class, a Log.wtf is called internally somewhere alerting me that it expected a certain amount of bytes, however some of those were not found.
Unparcelling of ...
0
votes
0
answers
18
views
'intent.getParcelableExtra' type mismatch, deprecated in Java
I'm trying to make a simple apartment rental app for a school project, but I have two problems that have stumped me. Here is the code for the DetailActivity.kt file:
package com.example.project.ui....
0
votes
0
answers
34
views
How to pass data Fragments Recyclerview to another Activity Recyclerview , parcelable, json , kotlin
How to display data from one Fragment's recyclerView to another activity's recyclerView using parcelable from local Json File. I want to pass data HomeFragment recyclerview to Activity RecyclerView ...
0
votes
1
answer
75
views
Parcelize annotation not working when inheritance
I have 3 classes
@Parcelize
open class Parent():Parcelable
data class Child1():Parent
data class Child2():Parent
I want to pass data from one activity to another in container class which is
class ...
2
votes
1
answer
596
views
Now in Android Application Structure (kts) need to add Parcelable plugin to some modules and features
I'm using the "Now in Android" multi module application as my "learn by example" base however I've hit another snag from a requirement to my data classes to support Parceable.
As ...
0
votes
1
answer
232
views
A field 'stability' is added in my Parcelable classes
Here is my class:
public class OutstandingContact implements Parcelable {
public String phoneNumber;
public String gstIn;
public String cin;
public String email;
public String ...
-1
votes
1
answer
595
views
Passing An Object In Api level 30 android 11 version
i am trying to pass data object from one activity to another activity using parcelable. it doesn't work in api 30 and android 11 version. i would like to know how can i pass a large size object in ...
0
votes
0
answers
23
views
Cannot show name or null from api when after login using getParcelableExtra
I want to display the name, what happens is that the name cannot be displayed or null. Here I use getParcelableExtra, I think my code still has errors, but I don't understand where the error is.
this ...
0
votes
1
answer
151
views
Gson.toJson(PrinterInfo) returns empty object
I'm trying to serialize an android.print.PrinterInfo object to JSON using Gson (version 2.9.0):
val type: Class<*> = data.javaClass
json.beginObject()
json.name(type.name)
json.value(gson.toJson(...
0
votes
0
answers
89
views
Why isn't my UI update in kotlin jetpack compose?
A map comes from another screen and when I make a deletion on that map, the data in the map is deleted, but since there is no UI update, there is no change on the screen, but when I make a change to ...
0
votes
1
answer
364
views
How do I define a custom class with Parcelable using Stable AIDL?
With the introduction of Stable AIDL, defined parcelables are required to be structured (Parcelables with their fields defined in AIDL are called structured parcelables).
https://source.android.com/...
0
votes
1
answer
126
views
when i use kotlin-parcelize in my application,after i build my project ,i get a error : can't find symbol readFromParcel
when i use kotlin-parcelize in my application,after i build my project ,i get a error : can't find symbol readFromParcel.
this is my BtDevice kotlin file :
import android.os.Parcelable
...
0
votes
1
answer
27
views
Parcel/un-parcel list of instances from base generic class
I have a base generic abstract class, lets call it Base<T> class.
This class extended by few subclass, with different types for T mData.
Let's say that I have class Sub1 extends Base<byte []&...
0
votes
0
answers
24
views
Entity implements Parcelable
I'm a Android Coder,The version of ObjectBox I was using was 3.1.2, and I couldn't make the entity class implement the Parcelable interface. If I did, I would get an error at run time ==> [class ...
5
votes
1
answer
944
views
firestore android adding "stability" field in custom Parcelable class while saving
I have a parcelable class Image
@Parcelize
data class Image(val id:String="",val url:String=""):Parcelable
and for saving in firestore
val data = HashMap<String,Any>()
data[&...
13
votes
1
answer
3k
views
'boolean java.lang.Class.isInterface()' on a null object reference
I'm facing this crash on Android 13 at following code.
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Class.isInterface()' on a null object reference
...
0
votes
0
answers
65
views
How can I pass an arraylist that contains a bitmap to another activity in Kotlin?
So this is my class:
class Pricecard(val img: Bitmap?, val title: String?, val weight: String?, val price: String?, val code: String?) : Parcelable {
constructor(parcel: Parcel) : this(
...
0
votes
1
answer
184
views
Android: Using Parcel to Generate a Deep Copy
I was told that it is possible to create a deep copy of an object by writing the object to a parcel, then immediately reading it out again.
So far, I have tried creating a Parcel and writing the ...
0
votes
1
answer
37
views
How to store ArrayList data when screen is rotated?
I tried storing array list data by using serializable and parcelable but in both case when I get the data using getParcelable and getSerializable. I am getting error due to @Deprecated or Type ...
3
votes
2
answers
1k
views
getParcelable() crashes due to null ifTable in AGP 8
I recently updated to AGP 8 and I released an update on to the play store. I am getting reports of some crashes in an area of code that was not changed recently. I am fairly confident this is a crash ...
2
votes
1
answer
1k
views
Why @Parcelize annotation requeres to implement abstract methods?
I am trying to get an advantage of auto-generated Parceable like (eg:) described here -
https://stackoverflow.com/a/63906355/5709159
or
https://medium.com/@BladeCoder/a-study-of-the-parcelize-feature-...
0
votes
1
answer
206
views
Unresolved supertypes: kotlinx.parcelize.Parceler
I'm trying to migrate from kotlinx.android.parcel.Parcelize to kotlinx.parcelize.Parcelize but I'm getting following issue while doing so:
Supertypes of the following classes cannot be resolved. ...
0
votes
0
answers
89
views
How to save the tree structure of classes in SharedPreferences
I've tried using Json, kotlin serialization, Parcelable, but nothing works.
The code of my class looks like this:
data class Item(
var name: String,
var children: MutableList<Item> = ...
0
votes
1
answer
48
views
Issue while parsing a list of objects retrieved from Firebase Firestore collection
I am working on an android project and I've been trying to use Firebase Firestore collections. Everything seems fine up until the second activity retrieving the intent with the parsed list of watches.
...
0
votes
1
answer
393
views
Why DeadObjectException during AIDL call using byte[] but not Bitmap?
Let's say there are two processes. I am interested in making an AIDL call (e.g. byte[] getBytes()) from an Activity (Process A) to a Service (Process B) which returns a byte[] of data.
However when ...
2
votes
4
answers
4k
views
Android getParcelableExtra deprecated in api 33
I want to use intent method for get uri from another activity, but intent.getParcelableExtra is deprecated.if I use
if (SDK_INT >= 33) {
intent.getParcelableExtra("EXTRA_URI&...
1
vote
0
answers
430
views
How to retrieve Parcelable objects in fragments correctly?
In a fragment,
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
var args = arguments
args?.getParcelable<...
0
votes
1
answer
107
views
How to add arraylist of header object to Parcelable object?
I must send an Object value to other Activity, so I found the way to using Parcelable Object. but this is the problem.
The problem is not parcelable object can not be add Parcelable object.
import ...
0
votes
1
answer
129
views
I want to pass date data to another fragment
I want to use DateDialogFragment and put the date I get there to another fragment
How do I put the set date after getting the calendar instance?
class DateDialogFragment : DialogFragment(), ...
0
votes
2
answers
3k
views
How to use Parcelize Annotation in Android Kotlin?
I am following https://developer.android.com/jetpack/compose/state#parcelize to make a Parcelable data class with Kotlin in Jetpack Compose, however the @Parcelize annotation is not available to be ...
2
votes
0
answers
148
views
Parcelize compile error in Kotlin 1.7 when a property's type is a value class
In a project, I have a Parcelize-annotated data class that contains a property whose type is a value class. E.g.:
@Parcelize
data class Example(val id: Id) : Parcelable
@JvmInline
value class Id(val ...
0
votes
0
answers
305
views
What is the difference between Parcelable and Serializable in Android and which one is the preferred way to pass data? [duplicate]
I've been using Serializable for a while now in Android to pass data between 2 Activities. However, I recently read about Parcelable. Do they work in the same way and which is the best/efficient way ...
0
votes
1
answer
142
views
How to add a Drawable object to a Parcelable object when I save the state of a custom view?
I am creating a custom view in android application. Custom view has Drawable object that is a vector image and is stored in folder res/drawable/
I want to save its state, so I create class SavedState ...
0
votes
1
answer
562
views
@IgnoredOnParcel annotation doesn't work for @Parcelize in Kotlin
I try to ignore a field when using the @Parcelize annotation in Kotlin so I am using @IgnoredOnParcel,
Plz guide me, on how to solve this error
error: Cannot figure out how to save this field into ...
0
votes
1
answer
22
views
My object is getting wrecked in the transfer from activity to activity, using Parcelable, in Android Studio
To give you a little context, I try to pass my 'match' object from the GamesBottomActivity to the GameActionsActivity. My Match model is implementing Parcelable and I have well implemented the ...
-1
votes
2
answers
671
views
Generic extension function Kotlin
Since getParcelable is deprecated for Android Tiramisu and later i want to make an extension function to get the parcelables from my Intent through my Bundle
So i have
val server = if (...
2
votes
1
answer
4k
views
How to pass an object through Navigation in Android compose?
I am using Navigation Compose, and I am trying to pass an entire object to the next screen, So I am using a shared ViewModel through hilt, and created a mutablestate variable of that object and want ...
1
vote
0
answers
48
views
Is there a way to unmarshal an Android Parcel object programatically using reflection?
I'm using an Android IBinder interface to read data from a service. My specific case dictates that I don't know exactly what object I'll be receiving from that service (due to versioning and server ...
1
vote
1
answer
98
views
Nested parcelable runtime execption
I am working on an Android app where I create an ArrayList of Parcelable object that contains an ArrayList of Parcelable object. To fit my case, it's a public ArrayList<FolderModel> folderList_;
...
0
votes
2
answers
163
views
Parcelable error occurred while using the Room
Parcelable error occurred while using the Room.
I'm studying Room, but I don't have much common sense yet. So I don't know why I use Parcelable.
I think there was an error when changing the format of ...
1
vote
3
answers
2k
views
getParcelableArrayListExtra causes a different type to be set to a variable
The problem starts with getParcelableArrayListExtra doesn't support type check when we try to set it to a variable. Let me give an example as basic as I can.
A User Class.
import kotlinx.parcelize....
0
votes
1
answer
202
views
Parcelable through broadcastReceiver returns null
I am trying to pass this custom list object to the broadcast receiver.
For that i am passing it like this:
Inside activity:
intent.putParcelableArrayListExtra(PARCEL_LIST_GEO, parcelItems.toArrayList()...
95
votes
5
answers
80k
views
The getParcelableExtra method is deprecated
I am passing Parcelable data into an Intent and getting it out on the other end using the getParcelableExtra(name:) method. However, getParcelableExtra(name:) seems to be deprecated. How do I fix the ...
1
vote
1
answer
969
views
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = java.util.ArrayList)
Reaching to ask for your help on this one.
I'm getting the error:
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = java.util.ArrayList)
I'm already ...
0
votes
3
answers
411
views
How to get ParcelableExtra from RecyclerView
I had one learning project that require RecyclerView item to send his detailed data to another activity with getParcelableExtra, my problem is when I clicked the item, the data is null on ...
0
votes
0
answers
108
views
Class Not Found When Unmarshalling: com.example.Parcelable.User
I'm facing following Errors/Exceptions when receiving data from one App to another App in Kotlin (Android):
Class Not Found When Unmarshalling: com.example.Parcelable.User
mExtras=Bundle[{)}]
...
0
votes
3
answers
130
views
How do i pass objects from 1 class to another?
I have 3 classes: MainActivity, homePage and createPage; and a list List<Recipe> recipeList = new ArrayList<>() in MainActivity.
The user enters the homePage from the MainActivity. From ...
0
votes
1
answer
453
views
RuntimeException: Exception inflating kotlin:navigation/nav_graph
We had a RuntimeException while we put a safeArgs into the navigation graph and this crash didn't give us any more guide to fix it.
In the first impression, we were following this to ensure that those ...
1
vote
1
answer
519
views
Reading a Hashmap on a Parcelable Constructor from a Data class in Kotlin
i'm currently building an app in kotlin, i'm trying to get the data from a single item on a recyclerview to later show it on a details screen, in order to do this im using a parcelable data class, and ...