LoaderManager.RestartLoader Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Starts a new or restarts an existing Loader in this manager, registers the callbacks to it, and (if the activity/fragment is currently started) starts loading it.
[Android.Runtime.Register("restartLoader", "(ILandroid/os/Bundle;Landroid/app/LoaderManager$LoaderCallbacks;)Landroid/content/Loader;", "GetRestartLoader_ILandroid_os_Bundle_Landroid_app_LoaderManager_LoaderCallbacks_Handler")]
[Java.Interop.JavaTypeParameters(new System.String[] { "D" })]
public abstract Android.Content.Loader? RestartLoader(int id, Android.OS.Bundle? args, Android.App.LoaderManager.ILoaderCallbacks? callback);
[<Android.Runtime.Register("restartLoader", "(ILandroid/os/Bundle;Landroid/app/LoaderManager$LoaderCallbacks;)Landroid/content/Loader;", "GetRestartLoader_ILandroid_os_Bundle_Landroid_app_LoaderManager_LoaderCallbacks_Handler")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "D" })>]
abstract member RestartLoader : int * Android.OS.Bundle * Android.App.LoaderManager.ILoaderCallbacks -> Android.Content.Loader
Parameters
- id
- Int32
int: A unique identifier for this loader. Can be whatever you want. Identifiers are scoped to a particular LoaderManager instance.
- args
- Bundle
Bundle: Optional arguments to supply to the loader at construction.
- callback
- LoaderManager.ILoaderCallbacks
LoaderCallbacks: Interface the LoaderManager will call to report about changes in the state of the loader. Required.
Returns
- Attributes
Remarks
Starts a new or restarts an existing Loader in this manager, registers the callbacks to it, and (if the activity/fragment is currently started) starts loading it. If a loader with the same id has previously been started it will automatically be destroyed when the new loader completes its work. The callback will be delivered before the old loader is destroyed.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-08-03 UTC.
Android reference for android.app.LoaderManager.restartLoader.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.