分页的列表视图 [英] pagination in listview

查看:114
本文介绍了分页的列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此先感谢。

我开发一个汽车复核申请,在那里用户可以登录并从数据库中显示的所有审查。所有的数据被存储在第一MYSQLdatabase。我使用JSON连接到MYSQLdatabase和SQLiteDatabase。但问题是,日志中的应用程序屏幕巨大的无后。数据的来自服务器和它被插入在我们SQLite数据库

I am developing a Car Review Application, where user can log in and displayed all the review from the Database. All the the data is being stored in MYSQLdatabase first. I am using json to connect to the MYSQLdatabase and SQLiteDatabase. But the problem is that, after log in the application screen huge no. of data is coming from the server and it is being inserted in our SQLite Database.

在它正被检索从数据库和列表视图显示在应用屏幕上,它走的是一条较长的时间来显示所有的数据以列表视图。在这种情况下,我使用的是SimpleCursorAdapter检索数据库中的所有数据。

After that it is being retrieved from database and displayed in the Application Screen in a list view, it is taking a longer time to displayed all the data in list view. In that case, I am using a SimpleCursorAdapter to retrieve all the data from database.

那么,有没有办法像分页之类的东西,使数据检索速度更快。 请帮助我,使部分源$ C ​​$ C。

So is there any way like pagination or something like that to make the data retrieval faster. Please help me by giving some source code.

推荐答案

您可以使用异步任务的概念,随着SimpleCursorAdapters。

You can use the concept of Asynchronous tasks along with SimpleCursorAdapters.

的AsyncTask能够适当且易于使用的用户界面线程。这个类允许进行后台操作而无需操作线程和/或处理程序发布在UI线程上的结果。

"AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers."

下面是你可以做的:

1)只检索第一个10/15项目在第一查询。 2)消防另一个查询作为后台任务,而用户检查出第一个10/15的项目。

1) Retrieve only 1st 10/15 items in the 1st query. 2) Fire another query as a background task, while user is checking out first 10/15 items.

这肯定会令用户体验到更快

This will certainly make the User experience faster

这篇关于分页的列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆