Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在不使用 Activity 类的情况下检索联系人?
我正在使用 LWUIT 开发 android 应用程序。我需要从 android 电话簿中检索联系人。怎么可能?
因为通常检索在扩展 Activity 类内部实现的联系人过程。(我看过一些例子)。
在 LWUIT 中,他们创建了自己的 Activity 类。所以我需要实现一些不在活动类中的其他类。
怎么可能?
联系人可从android.provider.Contacts(Android 1.6 及更早版本)和android.provider.ContactsContract(Android 2.0 及更高版本)内容提供商处获得。您不需要 Activity 来使用ContentResolver.
android.provider.Contacts
android.provider.ContactsContract
ContentResolver