本文介绍了android通讯录,内存不足问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在尝试使用ContentResolver.query(..)
检索我的联系人.问题是,我有5000个联系人,当运行时,它用尽了内存,尽管可以处理1000个联系人,但我应该怎么做


这是游标的代码

hi everyone, i''m trying to retrieve my contacts , using ContentResolver.query(..)
the problem is, i have like 5000 contacts, and when running, it runs out of memory, it''s working fine though with something like 1000 contacts, what should i do


here is the code for the cursor

final String[] CONTACT_PROJECTION = new String[] { Contacts._ID,
		Contacts.DISPLAY_NAME, };
ContentResolver cr = getContentResolver();

Uri contacts = Contacts.CONTENT_URI;
Cursor cur = cr.query(contacts, CONTACT_PROJECTION, null, null,
		Contacts.DISPLAY_NAME + " ASC");



感谢您的帮助



thanks for ur help

推荐答案


这篇关于android通讯录,内存不足问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 19:38