Lottie
Primary version
Primary version
  • Introduction
  • Android
    • Basic Workflow
    • Caching and Preloading
    • Dynamic Properties
    • Images
    • Performance
    • Lottie vs AVD
    • APK size
    • Troubleshooting
    • Contributing
  • iOS/MacOS
    • Docs
      • View Controller Transitions
      • Dynamic Properties
      • Adding Views to Animation at Runtime
    • Tutorials
      • Building a Dynamic Progress Loader
    • Troubleshooting
      • Performance
      • Troubleshooting
  • React Native
    • Sample App
    • Props
    • Troubleshooting
  • Web
    • Getting started
    • Video tutorial
    • Previewing
    • Expressions
    • Troubleshooting
  • After Effects
    • Getting started
    • Install Bodymovin Plugin
      • Bodymovin settings
    • General tips & guidelines
    • Sketch/SVG/Illustrator to Lottie walkthrough
    • Advanced Illustrator to Lottie walkthrough
    • Troubleshooting
  • Supported After Effects Features
  • Other Platforms
    • Mobile
      • Xamarin
      • NativeScript
      • Titanium
      • Windows (UWP)
    • Web Frameworks
      • React
      • Vue
      • Angular
  • Troubleshooting
  • Community Showcase
Powered by GitBook
On this page
  1. Android

Caching and Preloading

If your animation will be frequently reused, LottieAnimationView has an optional caching strategy built in. Use LottieAnimationView#setAnimation(String, CacheStrategy). CacheStrategy can be Strong, Weak, or None to have LottieAnimationView hold a strong or weak reference to the loaded and parsed animation.

You can also load a LottieComposition manually, hold a reference to it, and call LottieAnimationView#setComposition(LottieComposition) with the composition to have the animation load instantly rather than waiting for the deserialization.

PreviousBasic WorkflowNextDynamic Properties

Last updated 7 years ago