Passing RealmObject that implements Serializable not working
See original GitHub issueHello its my first time to use realm and i think its great it saves me time creating SQLite database for my app, however i tried passing RealmObject that implements Serializable from one Activity to another and it doesn’t work. it throws NullPointerException, I’m using version realm-81.1.jar please see my sample code below.
==== Sending Part ==== Intent intent = new Intent(sending class, receiving class); intent.putExtra(“entity”, testmodel); startActivity(intent)
==== Receiving Part ==== TestModel model = (TestModel) getIntent().getSerializableExtra(“entity”);
==== TestModel Code ==== public class TestModel extends RealmObject implements Serializable { private String name; private int id;
// getter and setter
}
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Implements Serializable on RealmObject 0.88 - Stack Overflow
Implement interfaces. Well, I try implement an interface (Serializable) without success. when I put a object on the intent I get this error:...
Read more >Serialization (C#) | Microsoft Learn
Serialization converts an object into a stream of bytes to store the object or transmit it to memory, a database, or a file....
Read more >Serialization in Java - DigitalOcean
Deserialization is the process of converting Object stream to actual Java Object to be used in our program. Serialization in Java seems very ......
Read more >Serialization and Deserialization in Java with Example
If a parent class has implemented Serializable interface then child class doesn't need to implement it but vice-versa is not true.
Read more >https://issues.jenkins.io/secure/attachment/18529/...
<p> * Use canonical path to avoid SVNKit/symlink problem as described in ... private static abstract class Credential implements Serializable { /** *...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No, we don’t have any plans to support
Serializable
.Well, re-querying is actually a much lighter operation, especially when operated on a primary key 😃