Stopping Saving and Releasing Activity Data in onPause


Build your own Android App Dev Empire

Get Instant Access

When another Activity moves to the top ofthe activity stack, the current Activity is informed that it is being pushed down the activity stack by way of the onPause() method.

Here, the Activity should stop any audio, video, and animations it started in the onResume() method.This is also where you must deactivate resources such as database Cursor objects if you have opted to manage them manually, as opposed to having them managed automatically.

I Note

Android provides a number of helper utilities for managing queries and Cursor objects. We talk more about these methods in Chapter 10, "Using Android Data and Storage APIs."

The onPause() method can also be the last chance for the Activity to clean up and release any resources it does not need while in the background.You need to save any uncommitted data here, in case your application does not resume.

Was this article helpful?

0 0
Easy Software Profits

Easy Software Profits

Here's How Anyone Can Start, Build and Run their Own Successful Software Empire Without Knowing the First Thing About Programming, Scripting Or Any 'Coder' Stuff. There is no doubt about it software sells. Software has a high percieved value and it solves problems for people.  A claim that can't always be made for PDF books, Video products and the like.

Get My Free Ebook


  • filiberta
    How to save object onpause?
    8 years ago

Post a comment