i am making an android widget which is active only when the screen is on, to prolong battery life. so i have one service which run all the time and reacts to ACTION_SCREEN_ON and ACTION_SCREEN_OFF. when the screen turns off i unregister other broadcast receivers and when the screen turns on i register them again.
my question is, what is the best practice, regarding battery life, to do when the screen turns off. is it better also to delete the broadcast receiver variables (i.e. m_Receiver = null;) or is unregistering enough? deleting means more free memory for the system, but causes garbage collection and extra memory operations (when the screen turns on i have to create a new receiver) which are expensive...