Added override functions to handle datasource object in the onResume and onPause states.