we do app:lottie_rawRes="@raw/great"
to fetch lottie file but how can we do it in java
to fetch lottie file like that as of XML
? I tired to do many things but could not solve that. how can I get that?
Asked
Active
Viewed 860 times
0

Dibas Dauliya
- 639
- 5
- 20
1 Answers
1
Setting up the animation from the xml file can be done in 2 ways:
by using app:lottie_fileName=”motorcycle.json”
or app:lottie_rawRes=”@raw/motorcycle”.
The code equivalent of the first is this:
av_from_code.setAnimation("motorcycle.json")
Note that your animaniton file must be in your assets folder.

evgenipc
- 26
- 6
-
1there is option of .setAnimation for from assets, from raw – Dibas Dauliya May 21 '20 at 12:25