Skip to content
Advertisement

Tag: parcelable

How to pass a list of objects from one activity to another using parcelable

I want to pass the list of itemselected or ItemsInCart to another activity. My Items Model implements parcelable. The problem is am getting error below in my SecondActivity class. Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void androidx.recyclerview.widget.RecyclerView.setLayoutManager(androidx.recyclerview.widget.RecyclerView$LayoutManager)’ on a null object reference at com.example.Project1.SecondActivity.onCreate(SecondActivity.java:59) Below is the code Model Item; } First Activity; The list that i want

RealmObject AND Parcelable

I’m new to Realm for Android so I’m not sure I’m approaching this the right way. I have a class which looks like this: The problem is the Parcelable interface contains methods like describeContents() writeToParcel() and RealmObjects aren’t supposed to have methods other than getters and setters: So my question is: How can I make these two work together? Is

Advertisement