I am developing an app for android and I have a java/android class that acts as a data controller which contains methods that update/delete/add data. I was wondering if there was a way for me to determine if the data has been updated/deleted/removed from within another class. I am looking for something like nsNotificationcenter in IOS, where you do something like
let notificationCenter = NotificationCenter.default
notificationCenter.addObserver(self, selector: #selector(userDefaultsDidChange), name: UserDefaults.didChangeNotification, object: nil)