开发者

Caching data when switching to full screen

开发者 https://www.devze.com 2023-03-14 05:23 出处:网络
I\'ve got an activity which has a gallery that is backed by an Adapter with data that was slowly retrieved over the network. I want to be able to switch to full screen and use a gallery backed by the

I've got an activity which has a gallery that is backed by an Adapter with data that was slowly retrieved over the network. I want to be able to switch to full screen and use a gallery backed by the same adapter. I don't want to have to reload all the data over the network just because I switched to full scr开发者_开发百科een mode. Do I need to cache the data (about 100 objects, each of which contains a string and a few images) temporarily and then reload it in the full screen activity or is there a better way? I tried getting a reference to the original gallery in the full screen activity, but findViewById() returned null.


For images you could use LRU caching(both on disk and in memory). As for objects - use Serialization.

0

精彩评论

暂无评论...
验证码 换一张
取 消