Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get specific changes from ChangeListener in Realm

Im trying to use the Realm-Database for my Android App. When I want to use the RealmChangeListener in my realm, it auto-creates the Method "onChange". That means if something is changed in the database, the program executes this method.

I want to get detailed information about what has been changed. That would be so cool!

Does anyone know something about this feature? I'll post the Code below for better understanding of what I'm trying to do.

Greetings, John

Code:

Realm realm =  Realm.getInstance(getApplicationContext()); 
realmListener = new RealmChangeListener() {
    @Override
    public void onChange() {
    Log.i("realmtest","some values in the database have been changed");
}};
realm.addChangeListener(realmListener);
like image 994
Coding John Avatar asked Aug 25 '15 10:08

Coding John


2 Answers

Fine grained notifications are now supported.

Source 1

Sample recyclerview

like image 60
Aks4125 Avatar answered Oct 04 '22 20:10

Aks4125


Fine grained notifications are not supported yet, but we're working on it :)

like image 37
Emanuelez Avatar answered Oct 04 '22 20:10

Emanuelez