<div>If I wanted to stop an activity as soon as it was initiated, how would I do that? The code below hangs with a grey screen.</div><div><br></div><div>Why would I want to do this? I am trying to understand how the sugar code base works. This seems like a good exercise for understanding how sugar activities start and stop.</div>
<div><br></div><div>Yes, this would be a bad user experience.</div><div><br></div><div>class NotTodayActivity( activity.Activity ):</div><div><br></div><div> def __init__( self, handle ):</div><div> activity.Activity.__init__( self, handle )</div>
<div><br></div><div> self._auto_shut_down = False</div><div> if not self.should_this_activity_run_today( ):</div><div> self._auto_shut_down = True</div><div> logger.debug( "goin' down" )</div>
<div> self.close( )</div><div> return</div><div> </div><div> def write_file( self, file_path ):</div><div> logger.debug( "write_file..." )</div><div> if self._auto_shut_down:</div>
<div> return</div><div><br></div><div> def should_this_activity_run_today( self ):</div><div> #todo: details go here</div><div> return False</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<br></div>