[英]ICursor is null when reading contacts Xamarin Android (Release)
Getting contacts from xamarin android is pretty straightforward and I've been using a LoaderManager
/ CursorLoader
to implement it rather that the Xamarin.Contacts
Addressbook
which is slow for 100+ contacts or more.从 xamarin android 获取联系人非常简单,我一直在使用
LoaderManager
/ CursorLoader
来实现它,而不是Xamarin.Contacts
Addressbook
,它对于 100 多个联系人或更多联系人来说很慢。
So my question is that on the DEBUG
build all contacts will just returns fine but when I build it to RELEASE
and casting the data
to ICursor
it will just returns null
.所以我的问题是,在
DEBUG
构建中,所有联系人都会返回正常,但是当我将其构建为RELEASE
并将data
为ICursor
它只会返回null
。
So I logged the possible causes and turns out it does not have the ICursor
interface implementation when RELEASED
.所以我记录了可能的原因,结果发现它在
RELEASED
时没有ICursor
接口实现。
Any info would be helpful.任何信息都会有帮助。 Thanks.
谢谢。
不是将ICursor cursor = data as ICursor
而是必须将其转换为ICursor cursor = data.JavaCast<ICursor>();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.