parcelable

How to find source of crashes of type java.lang.RuntimeException: Parcel android.os.Parcel@####: Unmarshalling unknown type code XXXX at offset YYY

若如初见. 提交于 2020-01-02 02:46:07
问题 Our crash reporting system is logging crashes of this type: Caused by java.lang.RuntimeException: Parcel android.os.Parcel@8bf0d1f: Unmarshalling unknown type code 6881391 at offset 356 at android.os.Parcel.readValue(Parcel.java:2779) at android.os.Parcel.readSparseArrayInternal(Parcel.java:3148) at android.os.Parcel.readSparseArray(Parcel.java:2362) at android.os.Parcel.readValue(Parcel.java:2757) at android.os.Parcel.readArrayMapInternal(Parcel.java:3067) at android.os.BaseBundle.unparcel

Is it good practice implementing Parcelable on a Room database entity?

半城伤御伤魂 提交于 2020-01-01 15:38:11
问题 I'm brushing on my Android dev skills and have been playing around with the Architecture Components. So I created an entity class using Room annotations for persistence to the database and implemented Parcelable on the entity class partly for the purpose of putting the entity object into an Intent object and passing it between activities/fragments. I just want to know if this is a good practice. Are there any cons of using such approaches such as database leaks or security flaws? Just curious

Is it good practice implementing Parcelable on a Room database entity?

不羁的心 提交于 2020-01-01 15:37:49
问题 I'm brushing on my Android dev skills and have been playing around with the Architecture Components. So I created an entity class using Room annotations for persistence to the database and implemented Parcelable on the entity class partly for the purpose of putting the entity object into an Intent object and passing it between activities/fragments. I just want to know if this is a good practice. Are there any cons of using such approaches such as database leaks or security flaws? Just curious

creating parcelable in android from some of the fields of a class

我们两清 提交于 2019-12-31 05:44:13
问题 i have the following class which i intent to pass from one activity to another: public class Ad extends ListItem implements parcelable{ private String _type; private String _recordID; private String _line1; private String _line2; private String _line3; private String _line4; private String _url; private IOnUiNeedToUpdateListener _listener; private boolean _notActive = false; private String _alertText; private Double _longitude; private Double _latitude; } i want to pass an array of such

com.android.support:appcompat-v7 and design version 23.2.0 crash parcel error

不问归期 提交于 2019-12-30 07:13:07
问题 I'm using in my app several libraries from android support and i update them when they are available. During the test of the version 23.2.0, i've got a crash when i change the app permissions on android 6. As you know, when the user disable a permission, the app is recreated (same way as when the device rotate) and your parcelable objects are saved and restored from a bundle. With the version 23.2.0, when the app is recreated, i've got a parcel error. I think that this error is not from my

Android app resets on orientation change, best way to handle?

百般思念 提交于 2019-12-30 05:09:07
问题 So I am making a basic chess app to play around with some various elements of android programming and so far I am learning a lot, but this time I am lost. When the orientation of the emulator changes the activity gets reset. Based on my research the same thing will happen anytime the application is paused/interrupted, ie. keyboard change, phone call, hitting the home key etc. Obviously, it is not viable to have a chess game constantly reset, so once again I find myself needing to learn how to

Passing ArrayList between activities

泄露秘密 提交于 2019-12-29 09:30:09
问题 I have an activity where I am adding objects into an ArrayList which implements the Parcelable interface. I then pass this list to another activity via a bundle however I get the following error when I try to print the size of the list in the new activity: java.lang.RuntimeException: Unable to resume activity {com.example.test/com.example.test.SectionsActivity}: java.lang.NullPointerException Here is the first activity where I add to list: @Override protected void onListItemClick(ListView l,

Passing ArrayList Object between activities using parcelable

此生再无相见时 提交于 2019-12-25 05:25:12
问题 Ill first start this off saying i have seen all the other posts that deal with this and have tried all of them. Im trying to do the same thing asked in the other posts, which is to pass the values of a ArrayList from one activity to another using Intent. I feel I have implemented my class(es) correctly. The main class (Route_Class) i am using is below. ``` public class Route_Class implements Parcelable { private double latitude = 0; private double longitude = 0; private double startingLat = 0

How to make RealmList<String> Parcelable?

我们两清 提交于 2019-12-25 02:27:12
问题 @Parcelize open class TestClass( @SerialName("title") var title: String, @SerialName("list") var list: RealmList<String> ) : RealmObject() { ... } How can I parcelize "list" variable in this implementation? It says, that it's not possible to parcel this type of value even if I add @RawValue . What's the alternative here? An example with explanation would be flawless. 回答1: Similarly to this approach, you can do fun Parcel.readStringRealmList(): RealmList<String>? = when { readInt() > 0 ->

Key _id expected Parcelable but value was java.lang.Long. while passing Parceable object between Activity

天大地大妈咪最大 提交于 2019-12-24 18:09:08
问题 I want to pass an object of my custom class to another activity. I came to know that Parceable is way and WAY faster than Serializable. But doing so i get the exception Key _id expected Parceable but value was java.lang.Long. The default value <null> was returned. I don't know what i am doing wrong with it. I followed these tutorials: Passing custom objects between android activities And the one very popular StackOverFlow answer The code of my object that implements Parcelable is as follows: