How gmail app does its loading ? does it use an ArrayAdapter(store the data in memory) or store the data in a sqlLite database as a source for its ListView.

Ps: Nexus 5 got hanged when I kept loading the gmail emails for a long time.

有帮助吗?

解决方案

I definitely use LoaderManager and load the rows from the internal database.

Emails are stored in internal database. You can see the rows and columns of the tables of the database using Root Explorer and proper SQLite viewer.

It also uses SyncAdapter to fill the database from the cloud. This is the most efficient way.

You can check LoaderManager here: http://developer.android.com/guide/components/loaders.html

And if you want to do the same and you want to create ContentProvider with a SQLite database you should try this: https://github.com/TimotheeJeannin/ProviGen

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top