Save cache when rotate device

前端 未结 3 1581
傲寒
傲寒 2020-12-06 15:52

I have a Gallerywiew.

I\'m using lazyload to download images but when I rotate device it reloads all images and does not use the cache.

3条回答
  •  盖世英雄少女心
    2020-12-06 16:22

    When you rotate the screen, you go through the activity lifecycle. The activity goes through onDestroy() and its onCreate() method gets called. You must redo any display calculations and view changes in onCreate and use the savedInstanceState to persist app data.

    I hope this is what you were asking

提交回复
热议问题