question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Passing RealmObject that implements Serializable not working

See original GitHub issue

Hello 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
cmelchiorcommented, Sep 22, 2017

No, we don’t have any plans to support Serializable.

2reactions
emanuelezcommented, Jul 14, 2015

Well, re-querying is actually a much lighter operation, especially when operated on a primary key 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found