implementing Animated Vector Drawable not Rendering on Older Android Versions (API < 21)
I've tried everything I can think of but This might be a silly question, but I've searched everywhere and can't find a clear answer. I'm working with a question where my Animated Vector Drawable (AVD) works perfectly on devices running Android 21 (Lollipop) and above, but it fails to render on devices below this version. I implemented the AVD in an ImageView as follows: ```xml <ImageView android:id="@+id/animated_image" android:layout_width="wrap_content" android:layout_height="wrap_content" app:srcCompat="@drawable/animated_vector_drawable" /> ``` In my activity, I load the drawable using: ```java ImageView animatedImageView = findViewById(R.id.animated_image); AnimatedVectorDrawableCompat animatedVectorDrawable = AnimatedVectorDrawableCompat.create(this, R.drawable.animated_vector_drawable); animatedImageView.setImageDrawable(animatedVectorDrawable); if (animatedVectorDrawable != null) { animatedVectorDrawable.start(); } ``` However, on devices running Android 4.4 (KitKat) and below, I see a blank space where the animation should be, and I'm not receiving any errors. I've checked that the vector drawable is defined properly with a compatible path. I even tried using a VectorDrawableCompat instead, but that didn't help either. I know that Animated Vector Drawables were introduced in API 21, but is there a way to have some sort of fallback for older versions? Should I consider using an alternative animation method, or is there a way to conditionally load different drawable resources based on the Android version? Any help would be appreciated! I'm working on a web app that needs to handle this. This is part of a larger mobile app I'm building. Is there a simpler solution I'm overlooking?