[英]How to load data from local sqlite db faster in Android?
I have about 300 records with multiple columns in sqlite db which I have to display in different textviews of a fragment. 我在sqlite db中有大约300条带有多列的记录,这些记录必须在片段的不同textview中显示。 So, while switching from one fragment to that very fragment then it loads slowly (it takes around 15 seconds or so to display those data).
因此,当从一个片段切换到那个片段时,它加载缓慢(显示这些数据大约需要15秒)。 What can be remedy to load the fragment faster?
有什么补救办法可以更快地加载片段?
Thank you in advance. 先感谢您。
You don't need to load all data at once, you need to look into "Lazy Loading" pattern, where you getting data on demand, when it really need to show up on the screen. 您不需要一次加载所有数据,您需要查看“延迟加载”模式,当真正需要在屏幕上显示数据时,您可以按需获取数据。
Here is one of many implementations - android-lazyloading-cursor 这是许多实现之一-android-lazyloading-cursor
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.