So the internal pause flag is set to true before truly pausing the activ-ity, and the activity is fully resumed before setting the internal pause flag to false.Recipe: Creating a Runnable ActivityThis recipe is an activity that evaluates a computationally intensive function, such as edgedetection in an image.