Save cache when rotate device

前端 未结 3 1576
傲寒
傲寒 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:36

    You need to override your onConfigurationChanged event.

    In my app I was playing music and when you flipped the phone it would stop and then I found out that if I overrode the config change I could just tell it to start my timer again and nothing was lost. I know this inst exactly what you wanted but it may help get you going in the right direction.

     @Override
                 public void onConfigurationChanged(Configuration newConfig) {
                   super.onConfigurationChanged(newConfig);
                  startTimer();
    
                 }
    

提交回复
热议问题