public void onActivityResume(Activity activity) { super.onActivityResume(activity); ConnectionFactory.getNowPlayingPoller(activity.getApplicationContext()) .subscribe(mNowPlayingHandler); if (mEventClient != null) { mEventClient.setController(this); } if (mMusicManager != null) { mMusicManager.setController(this); } if (mControlManager != null) { mControlManager.setController(this); } }
public void onActivityPause() { ConnectionFactory.getNowPlayingPoller(mActivity.getApplicationContext()) .unSubscribe(mNowPlayingHandler); if (mMusicManager != null) { mMusicManager.setController(null); mMusicManager.postActivity(); } if (mControlManager != null) { mControlManager.setController(null); } if (mEventClient != null) { mEventClient.setController(null); } super.onActivityPause(); }