public void removeObserver() { NotificationManager.getInstance().removeObserver(this, NotificationManager.audioDidReset); NotificationManager.getInstance() .removeObserver(this, NotificationManager.audioPlayStateChanged); NotificationManager.getInstance().removeObserver(this, NotificationManager.audioDidStarted); NotificationManager.getInstance() .removeObserver(this, NotificationManager.audioProgressDidChanged); NotificationManager.getInstance().removeObserver(this, NotificationManager.newaudioloaded); }
public void addObserver() { TAG_Observer = MediaController.getInstance().generateObserverTag(); NotificationManager.getInstance().addObserver(this, NotificationManager.audioDidReset); NotificationManager.getInstance().addObserver(this, NotificationManager.audioPlayStateChanged); NotificationManager.getInstance().addObserver(this, NotificationManager.audioDidStarted); NotificationManager.getInstance() .addObserver(this, NotificationManager.audioProgressDidChanged); NotificationManager.getInstance().addObserver(this, NotificationManager.newaudioloaded); }