During auto backup and restore operations, the system launches the app in a restricted mode to both prevent the app from accessing files that could cause conflicts and let the app execute callback methods in its BackupAgent. In this restricted mode, the app's main activity is not automatically launched, its Content Providers are not initialized, and the base-class Application is instantiated instead of any subclass declared in the app's manifest. Caution: To avoid errors, make sure that the parts of your app that execute in the restricted mode (mostly your BackupAgent) don't access content providers in the same app or attempt to cast the Application object.